Flee icon indicating copy to clipboard operation
Flee copied to clipboard

Unexpected Token Error if there is a "\" in a string

Open Cameron586 opened this issue 7 years ago • 2 comments

I am trying to parse some URL's into function arguments however as some contain backslashes FLEE throws a Unexpected character exception

Cameron586 avatar Jul 19 '18 08:07 Cameron586

Could you please provide example code?

eskaufel avatar Jul 21 '18 21:07 eskaufel

An example is this function as a string with the regular expression as a parameter. The \s is escaped because it's in a string inside my unit test. This will fail with the error about the unexpected token. "RegExToColumns(CallRole,\"([A-Za-z]+)\\s([a-zA-Z0-9 ]+)\",\"1:CallRollSplit\")"

To get around this though, you have to double escape the slash inside the string literal. "RegExToColumns(CallRole,\"([A-Za-z]+)\\\\s([a-zA-Z0-9 ]+)\",\"1:CallRollSplit\")"

coreyfournier avatar Sep 20 '19 18:09 coreyfournier