© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
2y ago
•
13 replies
sashok
Regex - Match a string outside of the parentheses
How do I match any
e
e
which
's not inside of the parentheses
?
I have created a pattern to do it
, but it doesn
't seem to work properly
. It should store
(
(
s and remove
)
)
s
, so that an
e
e
that is outside of the parentheses is matched e
.g
.
()()()e
()()()e
, but
e
e
inside of the parentheses isn
't e
.g
.
(e)
(e)
.
https://regex101.com/r/3m6ZUc/1
(?<=(?:[^()]|(?<a>\()|(?<-a>\)))+(?(a)(?!)))e
(?<=(?:[^()]|(?<a>\()|(?<-a>\)))+(?(a)(?!)))e
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Create regex that returns the match only
C
C# / help
4y ago
❔ Match literal escape strings with a regex
C
C# / help
3y ago