I don't know what the "s+" does.
It isn't "s+" but rather "\s+" - a small but very important distinction. \s is a character class which includes all whitespace (spaces, tabs, newlines). The + metacharacter matches one or more of the preceding item so this combination matches one or more consecutive whitespaces. See perlre or the Monastery's own tutorials for more on regular expressions.
In reply to Re^3: Counting characters without a space
by hippo
in thread Counting characters without a space
by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |