简体   繁体   中英

Java regex, digits, plus, minus, pound sign

I've never dealed with regex before. What combination should I use for string that contains only digits(0-9), plus(+) and minus(-) signs and also pound signs(#)? Order doesn't matter.

It is very simple:

[0-9+#-]+

Demo: https://regex101.com/r/dP1eL7/1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM