Regex different from regexr online website

I have regex formula that works fine online however, in uipath it seems to face an issue.
For example, the below string I want to replace the “-” with “0” without replacing “-” inside a parentheses. In Uipath it replaces all “-”. However, on the web using regex tool it works fine

bsData.Replace(System.text.RegularExpressions.Regex.Match(bsData,"([^\(\)\w\,\s\+\'\.\…\/]+)(?!\))").ToString,"0") this ([^\(\)\w\,\s\+\'\.\…\/]+)(?!\)) works fine on the web and it replaces the - with 0 if the - is not in parentheses

“INTANGIBLE ASSETS 82,433,575 3,828,042 78,605,534 80,877,930 Capital 232,707,267 232,707,267
Research And development costs 70,300,336 3,571,084 66,729,252 68,404,832 Subscribed uncalled capital (-) - -
Patents, licences, software And other similar rights 12,133,239 256,958 11,876,282 12,473,098 Share And merger premium - -
Retained earnings brought forward (+ ou -) 21,400,690 15,343,047”

Another example:

Replacing the selected " " with “|”,
I want to replace spaces between everything except two strings following each other. for example “Share And merger premium|-|-” or “INTANGIBLE ASSETS|82,433,575|3,828,042 78,605,534|80,877,930|”


Is this a glitch or am I doing something wrong, appreciate your help.
Thank you in advance

Hi @mounir.mohsen ,

Instead of the above expression, try the below :


Same goes for the other Expression as well, Change it to the below :


Here, as you could see we make use of Regex.Replace for replacing patterns of data with a String data.

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