http://www.perlmonks.org?node_id=484899


in reply to Re: Regular expression help
in thread Regular expression help

Okay...so I overcame that hurdle thanks to you guys...but now i need to find where a pattern match fails. Is it possible? For instance if i'm looking for digts and the string is 123a45 is there a way to inform the user that the pattern match is failing because of the "a"?

Replies are listed 'Best First'.
Re^3: Regular expression help
by admiral_grinder (Pilgrim) on Aug 18, 2005 at 18:50 UTC
    you can match with m/\d+/ and if that fails you can tell the user "string contains none numerical digit" or something like that.