in reply to Re: Check input sub - comments please...
in thread Check input sub - comments please...

$ should not be used in regexs unless you really want to allow a trailing "\n"; probably not the case here.

Well, since all whitespace has been normalized to single space (and leading and trailing whitespace has been removed), $ works as well as anything else here.

  • Comment on Re: Re: Check input sub - comments please...

Replies are listed 'Best First'.
Re: Re: Re: Check input sub - comments please...
by ysth (Canon) on Dec 15, 2003 at 08:10 UTC
    On the contrary, since it is impossible for there to be a trailing \n here, using $ instead of \z is misleading and wrong. It's just as incorrect as needlessly ending an unanchored regex with .*.