Skip navigation
Currently Being Moderated

inserting?

Jun 21, 2012 8:42 AM

I know this should be the most basic thing, but I just can't find anything on it. I find, say, any digit in a text, and want to add a period in front of it. But changing \d to .\d changes all digits to the literal expression .\d (same with \.\d and with putting \d in []). No idea.

 

Thanks a lot in advance

 
Replies
  • Currently Being Moderated
    Jun 23, 2012 2:10 PM   in reply to bustamant

    change (\d) to .$1

     

    In javascript you will have to escape the back-slashes, to it'll be (\\d)

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 3:58 AM   in reply to Harbs.

    Yes, you need to escape back-slash in javascript. \.\\d+

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points