U
usenet
I want to construct a regexp which will match a string containing only
\w and \s, but not repeated whitespaces. I can do it (crudely) with
two regexps, such as:
if (/[\w\s-]+$/ && ! /\s\s/) {
but I'd rather do it with a single regexp... but guessing at the syntax
has not proved effective.
I'd appreciate some insight...
Thanks!
\w and \s, but not repeated whitespaces. I can do it (crudely) with
two regexps, such as:
if (/[\w\s-]+$/ && ! /\s\s/) {
but I'd rather do it with a single regexp... but guessing at the syntax
has not proved effective.
I'd appreciate some insight...
Thanks!