|
追问 测试了下 "0-"无法通过。正则表达式好像不对。。。
追答
你要的是啥?
追问 我的要求是 string中只包含数字和-符号,欧博且至少包含一个数字和-字符。
追答
String regex="(\\d+[-]+)|([-]+\\d+)";
追问 对了。谢谢。不过我有个疑问。我加了/^(\\d+[-]+)|([-]+\\d+)$/和不加有区别吗? 本回答被提问者采纳
|
|
追问 测试了下 "0-"无法通过。正则表达式好像不对。。。
追答
你要的是啥?
追问 我的要求是 string中只包含数字和-符号,欧博且至少包含一个数字和-字符。
追答
String regex="(\\d+[-]+)|([-]+\\d+)";
追问 对了。谢谢。不过我有个疑问。我加了/^(\\d+[-]+)|([-]+\\d+)$/和不加有区别吗? 本回答被提问者采纳
|
Irritable bowel syndrome (IBS) is a common gastrointestinal disorder affecting u...
Download VLC Media Player for Windows for free. A powerful media player and stre...
https://www.cidrap.umn.edu/all-news US COVID declining after reaching peak Ne...
Are you looking for a gas station nearby in New York City? Check out the map to ...
*herbivore* Animal that feeds solely on plants. The term is most often applied t...
What does evident mean? Learn the meaning of evident and its definition. Underst...
Dades geogràfiques Localización: La Península de Crimea se sitúa en la costa nor...
Our list of interesting things to do in NYC today includes kick-ass fun, live sh...
Pelajari contoh iqlab, hukum tajwid penting yang mengubah nun mati atau tanwin m...
Anxious attachment is one of the types of insecure attachment style. Children wi...