Robert J Taylor wrote:
>
>[EMAIL PROTECTED] inquired:
>
> >> This regex looks familiar.  I'm going to suggest a big change in a
> >> bit.
> >> Oh, and [\s|\S], which could be [\s\S], is kind of awkward.
>
> > what is less awkward than [\s|\S] for 'match anything?'
>
>.
>
>Yes ->.<-
>
>Dot, period, point, et al, is the universal match "something" symbol. So,
>m'.*$' matches everthing on a line. If you want to match a period you can
>either escape it: \. or bracket it [.]. Escaping is better for simple
>matching.

Almost...  From "perldoc perlretut":

\s is a whitespace character and represents [\ \t\r\n\f]
\S is a negated \s; it represents any non-whitespace character [^\s]
The period '.' matches any character but "\n"

So, /[\s\S]/ would match a "\n", while /./ would not.  The equivalent of
/[\s\S]/, using period notation, would be /[.\n]/

Alan

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to