Syntactic Confectionery Delight | |
PerlMonks |
Re^3: dumb regex questionby Nkuvu (Priest) |
on Apr 07, 2009 at 01:01 UTC ( [id://755905]=note: print w/replies, xml ) | Need Help?? |
With that additional qualification, it will get a bit more tricky. My first thought was to add a space to the character class: m,"?(/[^" ]*)"?, But that doesn't work because it won't care that it has found a space inside or outside of a quote, and will stop the regex. Meaning it would capture just "/bootMe" from the line "/bootMe any text here". I'd suggest looking into a module like Text::xSV or Text::CSV_XS and setting the delimiter to spaces. Then reject any entry that doesn't have a leading slash. This means dropping the regex entirely. Something like:
Which gives the output:
In Section
Seekers of Perl Wisdom
|
|