in reply to Making regex /g match continuously

As I understand your description, you want to match once, not multiple times. The expression either passes or fails, in entirety. You don't want /g. You want an anchor and a quantifier.
^ (?: ## added this (?:int)\s+(\w+)\s*?\n (?:\s*Number\sof\sFlaps:\s(\d+)\s*?\n)? (?:\s*IP\sAddress:?\s([\d\.]+)\s*?\n)? )+\Z ## changed your last line
This will match one or more repetitions of your int/Flaps/Address pattern followed by the end of the string.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Making regex /g match continuously
by Eimi Metamorphoumai (Deacon) on Jan 07, 2005 at 19:39 UTC
    That would work, but the problem is that the $1, $2, $3 variables will only be set to (IIRC) the last values. So if you want to just test if the value matches, that's fine, but if you want to do something with the values, it's not as useful.