Menu
What is the escape character for regular expressions in Javascript?
My goal is to replace “^0^“ in the string “Deleted ^0^ from database” with “IDs” so the resulting string would be “Deleted IDs from database”. Though i’m having trouble creating a regular expression for this replacing. So i tried using / as the escape character but then i have this,
[CODE] “Deleted ^0^ from database” .replace(//^0^/, “IDs”)[CODE] but as you know // means a comment in javascript.
So what is the escape character in Regular expression for javascript, and if it’s foward slash (/) then how can i implement it in the example above?