in reply to pcre regex

Post your code with which you read the text file, maybe we can work out someting.
Oh, and d{4,4} == d{4}

I'm too lazy to be proud of being impatient.

Replies are listed 'Best First'.
Re^2: pcre regex
by Anonymous Monk on Apr 06, 2012 at 10:28 UTC

    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