![](/img/trans.png)
[英]Javascript - Regular Expression with string template followed by 4 digits number?
[英]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
$
是一個特殊字符,表示字符串的結尾。
轉義美元符號應該可以解決您的問題:
^\$\d*
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.