追问 测试了下 "0-"无法通过。正则表达式好像不对。。。
追答
你要的是啥?
追问 我的要求是 string中只包含数字和-符号,欧博且至少包含一个数字和-字符。
追答
String regex="(\\d+[-]+)|([-]+\\d+)";
追问 对了。谢谢。不过我有个疑问。我加了/^(\\d+[-]+)|([-]+\\d+)$/和不加有区别吗? 本回答被提问者采纳
|
追问 测试了下 "0-"无法通过。正则表达式好像不对。。。
追答
你要的是啥?
追问 我的要求是 string中只包含数字和-符号,欧博且至少包含一个数字和-字符。
追答
String regex="(\\d+[-]+)|([-]+\\d+)";
追问 对了。谢谢。不过我有个疑问。我加了/^(\\d+[-]+)|([-]+\\d+)$/和不加有区别吗? 本回答被提问者采纳
|
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...
Nunca, he visto un programa que represente una descripción tan precisa del lider...
Robert Lee Owens (1925-2017) had simultaneous careers as a concert pianist, voca...
独享ip代理是巨量http代理使用高性能主机构建的http/socks代理服务器,代理ip固定或每天更换一次,代理IP地址独享,稳定性极高、速度快、高匿名让您更...