java正则表达式将数字和字符串分开
我有这样的字符串:
BLAH00001
DIK-11
DIK-2
男士5
所以所有的字符串都是一种(任意字符序列)+(数字序列)
我想要这样的东西:
一,
十一,
二,
五,
为了得到这些整数值,我想将字符序列和数字序列分开,然后执行类似Integer.parseInt(number_sequence)
有什么东西可以做这项工作吗
问候
你可以在下面搜索框中键入要查询的问题!
我有这样的字符串:
BLAH00001
DIK-11
DIK-2
男士5
所以所有的字符串都是一种(任意字符序列)+(数字序列)
我想要这样的东西:
一,
十一,
二,
五,
为了得到这些整数值,我想将字符序列和数字序列分开,然后执行类似Integer.parseInt(number_sequence)
有什么东西可以做这项工作吗
问候
# 1 楼答案
# 2 楼答案
也许您想看看Java模式和Matcher:
# 3 楼答案
# 4 楼答案
试试这个:
产生: