Suppose I have the following string "a b c".
With regex I want to find the substring " b" (please mind the space before the letter b).
When I do
[ bbbbb ]+
You can use
( b) to match for the space and b together (Note the parenthesis are optional depending if you are trying to match for it)
See this Regex101.com example.
Also, when you use
[ b] it matches for a single character in the list (in this case a space and
b) so it does not look to see if they are consecutive.
Edit: If you are looking to match a non-whitespace character instead of just a space, you can use
\s is the token for a non-whitespace character.