titanium javascript error in regex compiler i think

hi all

got this code here:

return data.replace(/\//g,"!!!").replace(/=/g,"!!").replace(/+/g,"@@");

it is used to clean up this:


but in the info i get this as an error and the code fails to work:

line = 72;
message = "Invalid regular expression: nothing to repeat";
name = SyntaxError;
sourceId = 237349720;
sourceURL =

really annoying and seems to be a problem with actually using regex, your advice much appreciate.



— asked 5 years ago by David Parker
  • on breaking things down i find it is this .replace(/+/g,"@@") that is causing the error there are multiple + chars in this string

    — commented 5 years ago by David Parker
  • nope sorry the + needed to be escaped just been a bit dim today durrrr

    — commented 5 years ago by David Parker

0 Answers