Regular Expressions ?

  • Thread starter Thread starter anony
  • Start date Start date
A

anony

Hi,

I'm playing around with HTML pattern matching, and have a questions about
parsing more than one line of text. If I want to parse multiple lines of
text for a match, do I have to explicitly specify \n appearances in my
expression (meaning I would have to know how many lines I'm dealing with
ahead of time)? Seems like there's another way to do it. For example, say
I want to capture a string beginning with <tr> and ending with </tr> that
spans multiple lines in the HTML source. How do I tell it to include
newlines in the search without doing \n.*\n.* etc.

Thanks!
Brian
 
Line Breaking characters (\r\n) are simply characters in a string. You see
line breaks when displaying the string in NotePad or another text editor,
because that is how they are supposed to look. Treat them as you would any
other character. And BTW, the \s character class will match any white space
character, including carriage returns and line feeds.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top