RegexHub
RegexHub copied to clipboard
Regex for IP Range
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]