Mark,
You said you wanted to match
192.168.0.1 255.255.255.0
10.0.0.1 0.0.3.255
10.0.0.1/22
Here is what I've come up with
[code]
/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b\W\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b|\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b\W[0-9]{2}\b/
[/code]
Here is a screen shot of it matching
http://gyazo.com/07909bb45772713fe2c843c3fe90b7c9.png