簡體   English   中英

正好匹配一個 $(美元)后跟任意數量的數字的正則表達式應該是什么?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM