misterperl has asked for the wisdom of the Perl Monks concerning the following question:
scalar starts with "cat" but not ones followed anywhere with "dog".
I also have more complex conditions such as:
scalar starts with "cat" but not ones followed anywhere with "dog" except if its "dogs", or "dog" followed or preceeded by "collie".
I usually end up writing 2 or more regexs as cascading filters for these, and loop over the array- both undesirable since I'd prefer to use map(), and I think this could be one regex.
Wisdom please?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Im not sure what this regex is called or how to write it
by moritz (Cardinal) on Jul 28, 2011 at 13:54 UTC | |
by misterperl (Friar) on Apr 20, 2012 at 14:34 UTC | |
Re: Im not sure what this regex is called or how to write it
by jpl (Monk) on Jul 28, 2011 at 17:25 UTC | |
by misterperl (Friar) on Dec 18, 2012 at 14:36 UTC | |
by AnomalousMonk (Archbishop) on Dec 18, 2012 at 15:30 UTC | |
Re: Im not sure what this regex is called or how to write it
by Anonymous Monk on Jul 28, 2011 at 13:50 UTC |