Regex pattern for numbers with dots

前端 未结 4 933
没有蜡笔的小新
没有蜡笔的小新 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:40

    You could match with the following regular expression.

    (?

    Start your engine!

    The negative lookarounds are to avoid matching .1.3.164.1 and 1.3.164.1.. Including \d in the lookarounds is to avoid matching 1.3.16 in 1.3.164.1..

    Java's regex engine performs the following operations.

    (?

提交回复
热议问题