Skip to content

Instantly share code, notes, and snippets.

@kfly8
Created September 17, 2013 11:28
Show Gist options
  • Select an option

  • Save kfly8/6593086 to your computer and use it in GitHub Desktop.

Select an option

Save kfly8/6593086 to your computer and use it in GitHub Desktop.
後読み否定...
use 5.10.0;
use strict;
use warnings;
#perl -E 'say for q{12345 #123456 &#1234567; #12345678; &#123456789} =~ /(?<!&)#([0-9]+)/g'
for my $message ('12345', '#123456', '&#1234567;', '#12345678;', '&#12345678') {
if ($message =~ m/#([0-9]+)/) {
unless ($message =~ m/&#$1/) {
say $1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment