开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜