开发者

Help me write a regex that validates a number of any size that is between two special characters?

开发者 https://www.devze.com 2023-01-17 02:30 出处:网络
So that means \"$1$\" will pass as well as \"$50000000开发者_Go百科000000$\" or \"$12345678$\" length of number doesn\'t matter but it must be only digits and must start and end with a \'$\'.Try this:

So that means "$1$" will pass as well as "$50000000开发者_Go百科000000$" or "$12345678$" length of number doesn't matter but it must be only digits and must start and end with a '$'.


Try this:

\$\d+\$

And if you don’t want to allow leading zeros:

\$[1-9]\d*\$
0

精彩评论

暂无评论...
验证码 换一张
取 消