|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Regular ExpressionI'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 "Mark" <M***@discussions.microsoft.com> wrote in message Hi Mark,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) I found this utility very useful when trying to understand and construct regular expressions: http://www.regular-expressions.info/regexbuddy.html 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 > > > > Mark wrote:
> I'm trying to verify that a string conforms to the standard: It would help if you showed the expression you're using, so we could > > 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 possibly explain why it's not working, but you could try this: [0-9A-Za-z]+\\[0-9A-Za-z]+ Adam Ruth
writing commands to command prompt in VB.NET
Data Set to Excel ? vb.net serial IO problem da.update (syntax error in UPDATE statement) [Newbie] Customize Anchor properties ? SelectedIndexChanged causes selectedindex to reset to -1? Q: Activated How hard would this be? Focus problem with the tab control Playing Wav-files over 2 soundcards in VB.NET |
|||||||||||||||||||||||