RegEx matches a single character that does not follow a character

I have a regex, it's almost what I need. I am sure this is a repeat of the repeat, but I cannot find the answer I'm looking for.

Regex I need an expression that matches a bracket, followed by a space, however I want it to match a bracket.

(\([^\s])

This will match all parentheses that are not followed by a space, however, it matches the character immediately after the parenthesis. How to get a match only for brackets?

+4
source share
1 answer

Use Zero Width Approval View

\((?=\S)

or

\((?=[^\s])
+2
source

All Articles