Is the error in starting my regexp with (.*)?.
Your regexp doesn't start with that. Did you mean to type (.+) perhaps? Either way, yes, that's probably the issue. All of your .+ elements will greedily match as much text as possible while still allowing the entire thing to match. When you have several of them in the same regexp, there's a good chance they will match more of your text than you expect. It may help to make them non-greedy by changing them to .+? , or make sure they can't match certain characters by using an exclusionary character class like ([^"]+) to match as many non-double-quote characters as possible. Or find a different way to parse out the data you need.
Aaron B.
Available for small or large Perl jobs; see my home node.
In reply to Re: Question regarding exact regexp matching
by aaron_baugher
in thread Question regarding exact regexp matching
by Ekimino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |