473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Need help with regular expression

I need help design a reg exp.
I am parsing an html file to get the input values, here is one example

<input VALUE="Staff Writer" size=60 type="text" name="author">

Can I grab the value "Staff Writer" if name = "author"? is it possible using
regexp?

Thanks
Nov 21 '05 #1
2 1568
The following sites provide a wealth of information on regular expressions.

A tutorial & reference on using regular expressions:
http://www.regular-expressions.info/

The MSDN's documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp

Instead of writing your own parser or using RegEx, have you considered using
a SgmlReader (HTML reader)?

http://www.gotdotnet.com/Community/U...4-C3BD760564BC

Hope this helps
Jay
"news.microsoft.com" <fa****@managepoint.net> wrote in message
news:ex**************@TK2MSFTNGP12.phx.gbl...
I need help design a reg exp.
I am parsing an html file to get the input values, here is one example

<input VALUE="Staff Writer" size=60 type="text" name="author">

Can I grab the value "Staff Writer" if name = "author"? is it possible
using
regexp?

Thanks

Nov 21 '05 #2
Thanks for the links. Now I can get most of the information except for one
thing. There is a <textarea> tag anding with </textarea> and I am trying to
capture the text between these two tags and I am not getting it. Could it be
becuase of new line characters?
Here is my regex string
textarea.*name=""text"" cols=60>(?:""(?<1>[^""]*)""|(?<1>\S+)).*<textarea>

Thanks
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:ej****************@TK2MSFTNGP09.phx.gbl...
The following sites provide a wealth of information on regular expressions.
A tutorial & reference on using regular expressions:
http://www.regular-expressions.info/

The MSDN's documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp
Instead of writing your own parser or using RegEx, have you considered using a SgmlReader (HTML reader)?

http://www.gotdotnet.com/Community/U...4-C3BD760564BC
Hope this helps
Jay
"news.microsoft.com" <fa****@managepoint.net> wrote in message
news:ex**************@TK2MSFTNGP12.phx.gbl...
I need help design a reg exp.
I am parsing an html file to get the input values, here is one example

<input VALUE="Staff Writer" size=60 type="text" name="author">

Can I grab the value "Staff Writer" if name = "author"? is it possible
using
regexp?

Thanks


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Danny | last post by:
I am trying to do a regular expression to search for a url so anything that has http:\\www.hellothere.com but may not have the http:\\ and may not have the www and may not have http:\\www and...
2
by: Mike Andrews | last post by:
Guys, I've got a regular expression that will just not work. I can't get it work properly and I would like to see if someone out there can tell me if I'm doing this wrong, or if there is a...
4
by: Neri | last post by:
Some document processing program I write has to deal with documents that have headers and footers that are unnecessary for the main processing part. Therefore, I'm using a regular expression to go...
3
by: Joe | last post by:
Hi, I have been using a regular expression that I don’t uite understand to filter the valid email address. My regular expression is as follows: <asp:RegularExpressionValidator...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
3
by: Lucky | last post by:
hi guys, i'm practising regular expression. i've got one string and i want it to split in groups. i was trying to make one regular expression but i didn't successed. please help me guys. i'm...
17
by: Mark | last post by:
I must create a routine that finds tokens in small, arbitrary VB code snippets. For example, it might have to find all occurrences of {Formula} I was thinking that using regular expressions...
6
by: deepak_kamath_n | last post by:
Hello, I am relatively new to the world of regex and require some help in forming a regular expression to achieve the following: I have an input stream similar to: Slot: slot1 Description:...
14
by: Chris | last post by:
I need a pattern that matches a string that has the same number of '(' as ')': findall( compile('...'), '42^((2x+2)sin(x)) + (log(2)/log(5))' ) = Can anybody help me out? Thanks for any help!
0
by: altavim | last post by:
Usually when you make regular expression to extract text you are starting from simple expression. When you got to know target text, you are extending your expression. Subsequently very hard to ready...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.