Using square brackets creates a "character class", which means that it can match any one of a number of characters. \s is already a character class by itself, so you'd only put it in square brackets if you want to add other characters to the class (for example if you wanted to matches spaces or underscores, you'd use [\s_]).
I didn't know you could use classes like \n and \S inside the square brackets of a character class?
Steve
[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object:erlDesignPatterns)[/small]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.