Home All Groups Group Topic Archive Search About
Author
3 Oct 2006 6:10 PM
Mark
I'm trying to verify that a string conforms to the standard:

DomainName\Username

Domain and User can be letters and numbers (nothing else).  I've played
around with this, but my expression returns a match if there is more than one
'\'

Example:  dom\ain\Administrator (should not return a match, but does)

Thanks,
Mark

Author
3 Oct 2006 7:56 PM
Robinson
"Mark" <M***@discussions.microsoft.com> wrote in message
news:699A6F17-DCD1-4B5A-9969-DEFFA25AF228@microsoft.com...
> I'm trying to verify that a string conforms to the standard:
>
> DomainName\Username
>
> Domain and User can be letters and numbers (nothing else).  I've played
> around with this, but my expression returns a match if there is more than
> one
> '\'
>
> Example:  dom\ain\Administrator (should not return a match, but does)

Hi Mark,

I found this utility very useful when trying to understand and construct
regular expressions:

http://www.regular-expressions.info/regexbuddy.html
Author
3 Oct 2006 8:28 PM
Mark
Thanks!  That looks very promising. 

Mark

Show quoteHide quote
"Robinson" wrote:

>
> "Mark" <M***@discussions.microsoft.com> wrote in message
> news:699A6F17-DCD1-4B5A-9969-DEFFA25AF228@microsoft.com...
> > I'm trying to verify that a string conforms to the standard:
> >
> > DomainName\Username
> >
> > Domain and User can be letters and numbers (nothing else).  I've played
> > around with this, but my expression returns a match if there is more than
> > one
> > '\'
> >
> > Example:  dom\ain\Administrator (should not return a match, but does)
>
> Hi Mark,
>
> I found this utility very useful when trying to understand and construct
> regular expressions:
>
> http://www.regular-expressions.info/regexbuddy.html
>
>
>
>
Author
3 Oct 2006 9:37 PM
Adam Ruth
Mark wrote:
> I'm trying to verify that a string conforms to the standard:
>
> DomainName\Username
>
> Domain and User can be letters and numbers (nothing else).  I've played
> around with this, but my expression returns a match if there is more than one
> '\'
>
> Example:  dom\ain\Administrator (should not return a match, but does)
>
> Thanks,
> Mark

It would help if you showed the expression you're using, so we could
possibly explain why it's not working, but you could try this:

[0-9A-Za-z]+\\[0-9A-Za-z]+

Adam Ruth