Hello!
Thanks to another user here who directed me to a book and a site which explains regular expressions (I didn't even know that was the term I needed!) I have been using regex for form validation. I have run into a problem when trying to validate an IP address field. Using the code below, I am allowed to enter an octet of 256, and I am not sure what I did wrong. Is anyone able to easily see what's wrong?
if (!preg_match('/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/', $string)) {
} else {
}