JS Validation IP:Port

前端 未结 5 1014
既然无缘
既然无缘 2020-12-06 22:09

I have a question, on how to validate IP:Port together. example:

192.158.2.10:80 <--Valid

192.158.2.10 <---Invalid

So the port is a must, I fo

5条回答
  •  心在旅途
    2020-12-06 22:30

    I think '[0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+' might work as well

    You can test it at http://regex101.com/

提交回复
热议问题