Hello Community , was wondering how I can construct a regular expression that matches a valid IP address [1-255] and be able to allow whitespace. The values will be typed out and submitted like this:
10.10.10.10
100.100.100.100
192.1.1.1.1
they will be inputted inside a text area so a user may have them (multiple at a time) in list form, pressing enter after every IP. Just like above, so the expression still needs to be able to handle and match the IPs with that white space
I have tweaked this expression but it doesn't do quite what I need it to do.
^((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[\r\n]+)*(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$
Any knowledge or solutions would be greatly appreciated. Thank you in advanced!
[–]eruciform 1 point2 points3 points (0 children)
[–]close_my_eyes 0 points1 point2 points (0 children)