Help with pattern
I would like to match pattern - ",some.domain.name\user name". I tried using - . But didn't work.
Does anybody know the reason?
Are we talking PHP or Perl?
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.
I believe PHP is the same or very similar.