Regex.Split on plus and minus sign

前端 未结 2 1674
不知归路
不知归路 2021-01-21 07:43

I have a string 1.5(+1.2/-0.5). I want to use Regex to extract numerical value: {1.5, 1.2, 0.5}.

My plan is to split the stri

2条回答
  •  粉色の甜心
    2021-01-21 08:08

    Tried to escape signs like +?

    And why not a RegEx like /\d+\.?\d+/ ? This won't split it but return the numbers.

提交回复
热议问题