Matching decimals in strings using matcher()

后端 未结 2 402
一个人的身影
一个人的身影 2021-01-24 22:17

I have a question regarding the matcher. Currently I am trying to read a string and store all the digits into an array. My question is, how do you try to match both integers and

2条回答
  •  耶瑟儿~
    2021-01-24 22:57

    The phrase \d+ will match a string of numbers. So what about adding a dot between two of them? (\d+)|(\d+|\.\d+)

提交回复
热议问题