How to use specific character in series as delimiter for regex

I have a string as below:

Pressure ( + or - ) 30 daN
Current ( + or - )

I wanted to get 30 daN value. I tried to write:

Regex.Match(FullText, “(?<=Pressure( + or - ))([\S\s]*)(?=Current ( + or - ))”).Value.Trim

But function detects parenthesis as code. How can I fix that?


You need to ‘escape’ the parentheses by using a ‘\’

Like this:

Take a look at this solution I have made also.

Hopefully this helps


Thank you so much for your help, have a nice day!


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.