Don't ask to ask, just ask | |
PerlMonks |
Re^4: Likely trivial regex questionby moodywoody (Novice) |
on Nov 09, 2011 at 10:35 UTC ( [id://937026]=note: print w/replies, xml ) | Need Help?? |
Hi graff,
thanks for your efforts. As it happens I'm particularly interested in the part about which you wrote that you cannot explain it either (optional grouping not captured). As a workaround I've written to regexes coupled with if:
This does exactly what I want it to do; it's just that I'd like to learn if it's possible to achieve with a single regex. And if not, then why? While reading up and googling this I realized that I basically do not understand much about greedy/non-greedy quantifier and/or optional groups. For example I am also puzzled why captures "cat", but doesn't. Cheers
In Section
Seekers of Perl Wisdom
|
|