I am searching on a list by value on jquery and did this to escape spaces and find an input based on its values:
value.replace(/([^A-Z0-9])/g, '\\$1'))
but, after the page is rendered by the server, the result script end up as
value.replace(/([^A-Z0-9])/g, '\$1'))
notice the replace value has now only one \, and it doesn't work as I wanted.
Why the page rendering does that? If I move the JavaScript out of the jsp page, will it still do that once imported into the page?