Skip to content

Instantly share code, notes, and snippets.

@tom-lpsd
Created July 28, 2010 11:31
Show Gist options
  • Save tom-lpsd/494146 to your computer and use it in GitHub Desktop.
Save tom-lpsd/494146 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Data::Dump qw(dump);
use Regexp::Assemble;
my $regexp1 = Regexp::Assemble->new;
$regexp1->track;
$regexp1->add('foo.*');
$regexp1->add('bar.*');
dump($regexp1->match('foobarbaz')); # prints "foo.*"
my $regexp2 = Regexp::Assemble->new;
$regexp2->track;
$regexp2->add('foo.*');
$regexp2->add('bar.*');
dump($regexp2->match('foobarbaz')); # prints "1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment