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*\$
精彩评论