简体   繁体   中英

What should be the regular expression which matches exactly one $ (dollar) followed by any number of digits?

$ : 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

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

Escaping the dollar symbol should solve your problem:

^\$\d*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM