Regular expressions in JavaScript

Don't forget to replace "\" character with "\\" when working with regular expressions in JavaScript and use new RegExp( "expression" ). Otherwise JS will assume you are trying to declare special symbols (such as "\n" for the new line). From time to time I forget about this, and then I need to spend extra time to figure this out all over again. Today is one of those days.



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Slava
Posted on: 8/22/2006 at 1:10 PM
Categories: Web development
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

Friday, November 21, 2008 4:03 AM