Finding the intersection between two regexes

David Cantrell david at cantrell.org.uk
Mon Apr 21 01:42:23 BST 2014


Can anyone point me at some code on the CPAN that, given two regexes,
can figure out whether there are any bits of text that will be matched
by both?

eg, given /abc.../ and /...def/ it should tell me that there is an
intersection, because the string 'abcdef' matches both.

I'm not interested in covering all the utterly loopy things that one can
do with perl regexes, of course. What I'm really after is a version of
this:
  http://qntm.org/greenery

because I'm *far* too lazy to port it myself.

-- 
David Cantrell | London Perl Mongers Deputy Chief Heretic

We decided that in a world of 8 string guitars, 12 string basses
and drumkits from hell "shredding" in weird scat-jazz time
signatures that we wanted a stripped down song with lots of
shouting, and where the verse and chorus are the same chords.


More information about the london.pm mailing list