Need help with regular expression

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

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
 
J

Jay B. Harlow [MVP - Outlook]

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/d...l/cpconRegularExpressionsLanguageElements.asp

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

http://www.gotdotnet.com/Community/...mpleGuid=B90FDDCE-E60D-43F8-A5C4-C3BD760564BC

Hope this helps
Jay
 
N

news.microsoft.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top