Friday, 20th January 2006
Tag Soup: Crazy parsing adventures. More bizzare browser behaviour.
Escaping regular expression characters in JavaScript
JavaScript’s support for regular expressions is generally pretty good, but there is one notable omission: an escaping mechanism for literal strings. Say for example you need to create a regular expression that removes a specific string from the end of a string. If you know the string you want to remove when you write the script this is easy:
[... 362 words]