r"
(?:(?:^edit\ \"(.+)\"$\n)(?:^set\ uuid\ ([a-f0-9]{8}\-(?:[a-f0-9]{4}\-){3}[a-f0-9]{12})$\n)(?:(?:^set\ comment\ )((?:(?!^set\ )(?:.*$\n))+)(?=^set\ ))?(?:^set\ service\ (\".+\")$\n)?(?:^set\ extip\ ((?:(?:\d{1,3}\.){3}(?:\d{1,3}))(?:\-(?:\d{1,3}\.){3}(?:\d{1,3}))?)$\n)(?:^set\ extintf\ \"(.+)\"$\n)(?:^(set\ portforward)\ (enable)$\n)?(?:^(set\ color)\ (\d{1,2})$\n)?(?:^set\ mappedip\ \"((?:(?:\d{1,3}\.){3}(?:\d{1,3}))(?:\-(?:\d{1,3}\.){3}(?:\d{1,3}))?)\"$\n)(?:^(set\ protocol)\ (.+)$\n)?(?:^(set\ extport)\ (\d{1,5}(?:\-\d{1,5})?)$\n)?(?:^(set\ mappedport)\ (\d{1,5}(?:\-\d{1,5})?)$\n)?(?:^next$\n(?:^$\n)?))
"
gm