regex – regexp shorthand for ‘boundary’ between whitespace and non-whitespace?
The shorthand \b in a regular expression matches a ‘boundary’ between word-characters and non-word characters, i.e. a place in a string where on the one side there’s a word character, and on the other side there’s a non-word character or the boundary of the string.
Is there a similar construct to match boundaries between non-whitespace and whitespace? Specifically, I’d like a shorthand to match a position in the string where on the one side there’s a non-whitespace character, and on the other side there’s a whitespace character or the boundary of the string.
(That’s actually what I naively expected the behavior of \b to be before I realized that it wasn’t.)
Read more here: Source link
