You talk about "match pattern" but what are you trying to achieve. Is it you are looking for a match with a particular pattern (,domain\username) or are you seeking to extract domain and username.
I am weak on PHP but in perl something like
my $thisstring = 'xxx,some.domain.name\username';
print "true" if ($thisstring =~ m/,[^,]+\\[^,]+/);
my ($domain, $username) = ($thisstring =~ m/,([^,]+)\\([^,]+)/);
That is the string must start with a comma, then consist of two parts separated by a slash. The characters in the parts can not be a comma.
Bookmarks