so given:
192.168.1.0 / 255.255.255.0 [256 ips] *** OPEN ***
192.168.1.0 / 255.255.255.0 [256 ips] *** OPEN *** some kind of desc
192.168.1.0 / 255.255.255.0 [256 ips] *** OPEN *** [alert]
192.168.1.0 / 255.255.255.0 [256 ips] *** OPEN *** (notation of some sort)
what i want is a pattern that will match JUST that first line (capturing IP / MASK / # of ips) with the following in mind:
-spacing is variable
-the '/' between ip and mask is optional
-the brackets around the ips can be (), [], {}
-the num of * around OPEN is variable
-case-insensitive
... i already have the patterns to grab the other lines (which work perfectly), but if my pattern is:
$pattern = '/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\s\/\s|\s)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s?(?:\[|\(|\{)\s?(\d{1,3})(?:\sips\s?)(?:\]|\)|\})\s?(?:\*)*\s?(?:OPEN)\s?(?:\*)*/i';
which works on the website i linked in my first post... in code it matches ALL the conditions (too greedy somehow?) which causes 100's of dupes