in reply to Req Expression translation
\s+ will match at least one whitespace character¹. The match will consume as many as it can.
.*? will match 0 or more characters (except for newlines, which it will only match if the /s modifier is given.) The ? makes the match non-greedy. It will match as little as is possible. It isn't particularly useful unless there is something after that portion of the regex.
1. Bold text added for exactness. See comments below. \s is equivalent to the character class: [ \r\n\f\t]. (And thanks to diotalevi for catching my laziness.)
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Req Expression translation
by diotalevi (Canon) on Jun 13, 2003 at 21:25 UTC | |
by sauoq (Abbot) on Jun 13, 2003 at 22:41 UTC | |
|
Re: Re: Req Expression translation
by Anonymous Monk on Jun 14, 2003 at 02:34 UTC | |
by sauoq (Abbot) on Jun 14, 2003 at 03:49 UTC | |
by Anonymous Monk on Jun 14, 2003 at 17:16 UTC |