Perhaps you need to change the final \D to \D* since it is possible that there is nothing after the 7 digits. Or perhaps omit the last \D completely.

Your code works with;
  $body='Library Card: 0240742 ';  # has a character after the 7 digits
but fails with;
  $body='Library Card: 0240742';    # no character after the 7 digits


jim


David Budd wrote:

I thought this was working, but my logs just showed a case where it seems not 
to do what I want.
Why does:
$OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ;
Not become true when $body contains:
Library Card: 0240742

Just possibly there's some dodgy html or something in the original that doen't 
make it through to my logs, but right now I'm perplexed
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to