Home > Back-end >  Use regular expressions to verify IP
Use regular expressions to verify IP

Time:02-28

Your bosses, originally is to want to parse the string to determine them one by one, but feel a little bit with regular is more convenient, because the regular is not very familiar with, so consult your bosses corresponding regular should be how to write?
(note: only supports ipv4)
1, in the form of single IP
2, IP section of the form such as 10.10.1.1-10.10.1.100 small IP in front, large IP behind
3, IP/mask form, such as 10.10.1.1/24

CodePudding user response:

You a regular expression for reference address, write very detailed
  • Related