www.webdeveloper.com
Results 1 to 2 of 2

Thread: regular expression - replace function

  1. #1
    Join Date
    Feb 2011
    Posts
    90

    regular expression - replace function

    Hi, the code:
    Code:
    name.replace(/[\[]/, "\\[")
    As far as I understand it replace "[" with "[", so actually do nothing, am I wrong?

    Because I have seen this code, but I couldn't figure out what good is it for?

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,656
    it replaces "[" with "\[" (may be for safety reasons)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles