in reply to Re: Req Expression translation
in thread Req Expression translation

\s+ will at least one space
That's "whitespace". "space" is a character which happens to be whitespace, there are four other characters that match it as well (tab, space, carriage return, line feed, vertical tab)

[Added - sauoq caught me out on the VTAB vs FF character. I never use either so I forget that part. I knew chr(12) was whitespace (through running perl -le '$,="\n"; print grep chr() =~ /\s/, 0 .. 255') but I didn't remember what it was.]

Replies are listed 'Best First'.
Re: Re: Re: Req Expression translation
by sauoq (Abbot) on Jun 13, 2003 at 22:41 UTC

    Yes, of course; "whitespace."

    Your list is wrong though. You are missing form-feed ("\f") and you have incorrectly included a vertical tab.

    perl -le 'print "\f" =~ /\s/ ? "match" : "no match"' # form-feed perl -le 'print chr(11) =~ /\s/ ? "match" : "no match"' # 11 is vertic +al tab.
    -sauoq
    "My two cents aren't worth a dime.";