Skip to content

Instantly share code, notes, and snippets.

@kkosuge
Forked from Shinpeim/reg_9m.pl
Created January 15, 2012 05:26
Show Gist options
  • Save kkosuge/1614489 to your computer and use it in GitHub Desktop.
Save kkosuge/1614489 to your computer and use it in GitHub Desktop.
use Regexp::Assemble;
my $ra = Regexp::Assemble->new;
$ra->add( '^9m[^0-9a-zA-Z]' );
$ra->add( '[^0-9a-zA-Z]9m$' );
$ra->add( '^9m$' );
$ra->add( '[^0-9a-zA-Z]9m[^0-9a-zA-Z]' );
print $ra->re; #(?-xism:(?:[^0-9a-zA-Z]9m(?:[^0-9a-zA-Z]|$)|^9m(?:[^0-9a-zA-Z]|$))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment