in reply to Pattern matching of the type?

HOW to restrict the statement to endup with 5 digits .not greater than 5 digits or nor less than 5 digits. i mean that 501-77-1245342/pin-67543

Replies are listed 'Best First'.
Re: Re: Pattern matching of the type?
by Hofmator (Curate) on Dec 12, 2001 at 14:24 UTC

    You probably need to put the eol meta character at the end of your regex, something like this:

    m/ \d{5} # exactly five digits $ # end of line /x; # allow comments and whitespace

    -- Hofmator