When i give it user input it matches the regex
print "Please enter the string "; chomp($string=<STDIN>); $regex= "^\d{4,4}[A-Z0-9]$ "; if ($string =~ m!($regex)!g) { print 'match'; print "$regex"; } else { print 'no match'; print "$regex"; }
It matches the regex in this case but when the input is a text file it fails to recognize any patterns
In reply to Re^2: pcre regex
by Anonymous Monk
in thread pcre regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |