RegexHub icon indicating copy to clipboard operation
RegexHub copied to clipboard

Regex for IP Range

Open perfecto25 opened this issue 8 years ago • 0 comments

dont have time to submit pull req, but this regex checks for IP validity, can provide 1 IP addr or a range, ie

192.168.5.100-192.200.20.255

^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^.*-,{3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$

you can check it here https://regex101.com/

Also for email, this regex is more encompassing ^[a-zA-Z0-9_.+-]@[a-zA-Z0-9_.+-].[a-z][a-z][a-z]

perfecto25 avatar Dec 02 '16 18:12 perfecto25