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) ;
What's the last \D for ? '\s*?' should just be '\s*' - same with \D*?. > 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 use strict; use warnings; my $body = 'Library Card: 0240742'; my $OK_body = ($body =~ /library\s*card\D*(\d{7})/i); print "OK_body = ", $OK_body ? 'true' : 'false', "\n"; __END__ -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs