-2
$ : match results $
$637 : match results $637
$$ : match results $
$272$ : match results $272
$262$$ : match results $272
$$445: match results $
3727 : match results null
2727$: match results null
Mike Cluck
  • 28,921
  • 12
  • 72
  • 85
himanshu
  • 190
  • 2
  • 15
  • I don't see any code that you have tried. Could you tell us what you have done so far and what you're stuck on? – Mike Cluck Feb 02 '17 at 20:02
  • Possible duplicate of [Reference - What does this regex mean?](http://stackoverflow.com/questions/22937618/reference-what-does-this-regex-mean) – Jordan Running Feb 02 '17 at 20:04
  • Hi Mike. I want to replace all the characters from a string except $ followed by any digit. String should contain $26272 I.e [Dollar][digit] format only – himanshu Feb 02 '17 at 20:14

1 Answers1

0

$ is a special character that represents the end of the string.

Escaping the dollar symbol should solve your problem:

^\$\d*
TimoStaudinger
  • 34,772
  • 13
  • 76
  • 86