Skip to content

Instantly share code, notes, and snippets.

@sng2c
Last active December 27, 2015 01:29
Show Gist options
  • Save sng2c/7245491 to your computer and use it in GitHub Desktop.
Save sng2c/7245491 to your computer and use it in GitHub Desktop.
컴파일된 정규표현식의 원래 입력패턴을 알아내는 법
#!/usr/bin/env perl
use re 'regexp_pattern';
my $reg = qr/(?i)abc/s;
my ($pat,$flag) = regexp_pattern $reg;
print "pat :$pat\n"
print "flag:$flag\n";
# pat :(?i)abc
# flag:is
# flag를 반드시 확장표현식으로 넣자. 그래야 저장해 놓고 꺼내 쓰기가 좋다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment