But if I insert the same Regex MAL?[\\p{L}\\p{N}]*(\\s|$|\\p{P}|\\{Sc}) in a cell or a variable called MyRegex and I write the following code it does not work and I get as a result a null "?":
regexReplace($Text$, $MyRegex$, "aaa123")
This problem does not appen if the regex does not contain the curly brackets {}
With $MyRegex$ I was referring to a field name... I also tried with the creation of a variable and the use of $${SMyRegex}$$ but it didn't work beacuse this is not the problem.
The problem is that if the regex contains curly brackets and it is inserted in a variable the following code doesn't work:
regexReplace($Text$, $$MyRegex$$, "aaa123")
If the regex doesn't not contain any curly brackets then it works.
How could I solve this problem?
Thanks
P.S. I also tried adding \ before the curly brackets. This avoid to ge a null ? as a result but nothing is replaced because there are no matches with this regex...
P.S.2 In my prevoius message there is a typing error from my side. The regex is not MAL?[\\p{L}\\p{N}]*(\\s|$|\\p{P}|\\{Sc}) but it is MAL?[\\p{L}\\p{N}]*(\\s|$|\\p{P}|\\p{Sc})