|Think about Loose Coupling|
Im not sure what this regex is called or how to write itby misterperl (Beadle)
|on Jul 28, 2011 at 13:38 UTC||Need Help??|
misterperl has asked for the
wisdom of the Perl Monks concerning the following question:
I guess this might be one of those look-ahead assertions or something, but frequently I'm seeking something like
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.