|
|
| P is for Practical | |
| PerlMonks |
dumb regex questionby linuxfan (Beadle) |
| on Apr 06, 2009 at 23:57 UTC ( #755895=perlquestion: print w/ replies, xml ) | Need Help?? |
|
linuxfan has asked for the
wisdom of the Perl Monks concerning the following question:
Monks,
"/moreIters 10" If the string begins with a quote, I need all data enclosed within the quotes, else the entire string that begins with / To begin with, I wrote the following simplistic regex: which means match zero or 1 double quote, followed by / followed by any number of characters followed by an optional double quote. However, this doesn't work because .* matches the quotes as well, and I get the following: The above works for strings such as /justThis: How can I refine this regex to get the desired result? Thanks!
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||