What does "\S" equal in Regex?
I have a regex:
/<((?:https?\:\/\/)*(?:[^\/?#])\/*\S*)>/ig;
trying to match:
What does \S equal? e.g.: [\w\d?:"-_]
What does "\S" equal in Regex?
I have a regex:
/<((?:https?\:\/\/)*(?:[^\/?#])\/*\S*)>/ig;
trying to match:
What does \S equal? e.g.: [\w\d?:"-_]
\S
matches anything except whitespace.
Regard as the opposite of \s
(which matches whitespace).
(Personally I find \S
obfuscating for this reason, particularly when viewing in some fonts where S and s look too similar. I prefer [^\s]
).