in reply to Re: pcre regex
in thread pcre regex

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