jsonata-java icon indicating copy to clipboard operation
jsonata-java copied to clipboard

Difference in regex escaping

Open aeberhart opened this issue 1 year ago • 0 comments

Input:

"http://example.org/test{par}"

Expression:

$replace($, /{par}/, '')

Output:

java.util.regex.PatternSyntaxException: Illegal repetition near index 1
{par}
 ^
	at java.base/java.util.regex.Pattern.error(Pattern.java:2028)

should be:

"http://example.org/test"

It works as expected, if the expression escapes the curly brackets:

$replace($, /\{par\}/, '')

aeberhart avatar Oct 13 '24 12:10 aeberhart