Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Smart Value Escaped Characters

Aron Kuch November 30, 2023

I was trying to split a string that was | delimited. Turns out .split("|") broke it into a list of individual characters. Instead .split("\|") had the intended effect.

So | requires an escape character. What other characters require escaping? Add what you have found in the comments.

1 comment

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 14, 2023

Hi @Aron Kuch 

That is an interesting question, and I also find the escape-needing characters for rules (with and without the Atlassian implementation of regular expressions) are not documented...or at least not on the automation documentation pages :^)

I wrote a quick test rule, using most of the printable characters in a created variable to drive an advanced branch, using your split("|") technique, and then used each one to split the very same string without escaping.  These are the ones which did not work at all (and so probably need to be escaped):

?
$
'
(
)
*
+
-
.
?
|

And these seem context-dependent for the string being split:

"

The remainder all seemed to work, but I would test further if I needed this for a production rule.  If you try the same test, please post what you find.  Thanks!

 

Kind regards,
Bill

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events