Regex pattern for numbers with dots

前端 未结 4 1013
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 08:58

I need a regex expression for this

any number then . and again number and .

So this is valid

1.3.164.1.2583.15.46
546.598.856.1.68.268.695.5         


        
4条回答
  •  没有蜡笔的小新
    2021-01-13 09:48

    This one [0-9]+([.][0-9]+)* equivalent to \\d+([.]\\d+)* is valid for

    1.3.164.1.2583.15.46 , 546.598.856.1.68.268.695.5955565 and 5465988561682686955955565

    And this one [0-9]+([.][0-9]+)+ equivalent to \\d+([.]\\d+)+ is valid for

    1.3.164.1.2583.15.46 and 546.598.856.1.68.268.695.5955565 but not for 5465988561682686955955565

提交回复
热议问题