regular expression help

2006-07-24 Thread Jonathan Weber
Hi. I have some HTML files with lines like the following: a name=w12234 /a h2A Title/h2 I'm using a regular expression to find these and capture the name attribute (w12234 in the example) and the contents of the h2 tag (A Title). $_ =~ /a name=(w\d+)\s*\/a\s*h2(+)\/h2/ That's my regex,

Re: regular expression help

2006-07-24 Thread Jonathan Weber
On 24 Jul 2006, at 5:48 PM, Rob Dixon wrote: - The character wildcard '.' is just a dot within a character class, so [.\n] will match only a dot or a newline Ah, I hadn't realized that characters in [ ] are literals. That clears up a lot of the problem. - Regexes aren't the best way of