/^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/
042199255·256300071000
Regex for IPv4 addresses: matching 0 to 255 properly
An IPv4 address is four numbers from 0 to 255. Here's why the obvious \d{1,3} pattern lets 999.999.999.999 through, how to match one octet with alternation, what to do about leading zeros, and how to find addresses inside text.
Regex Hunter