$re = '/Group\sMembership:\s+(([A-Za-z0-9-_]+\\\\)((?<test>[A-Za-z0-9-_ ]+))\s+)/m';
$str = 'Subject:
Security ID:
Account Name:
Account Domain:
Logon ID:
Logon Type: 3
New Logon:
Security ID: ABC\\SH07
Account Name: SH07
Account Domain: ABC
Logon ID: 0xEB7A5403
Event in sequence: 1 of 1
Group Membership:
ABC\\Domain Users
Everyone
BUILTIN\\Users
NT AUTHORITY\\NETWORK
NT AUTHORITY\\Authenticated Users
NT AUTHORITY\\This Organization
ABC\\FS-ABCDEFG-Workspaces_CS-Production-WIP_MODIFY
ABC\\FS-ABCDEFG-Workspaces_CS-EntertainmentDesign-WIP_READ
ABC\\FS-ABCDEFG-Wspaces_CS-Print-WIP_READ
ABC\\Workstations-Desktop-Add Remove
ABC\\FS-ABCDEFG-Wpaces_CS-Imagery-WIP_READ
Authentication authority asserted identity
ABC\\APP-JDE-123';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php