parsing "\(|.*?)|)" - Too many )'s.
I am receving this error when writing this…
private static Regex resourceTextsREGEX = new Regex(@"\(|.*?)|)", RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.IgnoreCase);
I want a regular expression for these two things 1- {Text} 2- |Text| I want to be able to get those matches and replace them with something …can someone help please?
According to your example what you want to match you might have to want something like this
See it here on Regexr
So you want to match
1. {Text}
2. |Text|
My regex is matching at first
[{|]either a{or a|Then comes a capturing group that gets your text using a lazy match
(.*?)And at last the closing character is matched
[|}]meaning either}or|