YAY! I'm thinking it should be along the lines of
$regex="/username=[a-z0-9]{2,20}\sid=[0-9]{4,6} (referrer=\[(?R)\])?";
[code]
This is just a simple example I though up to illustrate the point. I'm actually going to be using it to dissect iptables log files. You somtimes get this near the end of a log (not sure what it means ... not my problem really) TYPE=3 CODE=3 [SRC=/*and from here on it's like another iptables log line*/]. So it just got me thinking , I wonder if recursive regex is possible.
Thanks MyHappiness, you've certainly made my world a little happier today ;)
Bubble