in reply to Regexp to match IP address
Be aware that your code doesn't do what you think. It checks for 4 single digits separated by periods. \d checks for a single digit, not a number. The code is too simplistic to really check for an IP address.