RE: Newbee question on regular expressions

From: vvenk (vvenk_at_discussions.microsoft.com)
Date: 11/10/04


Date: Wed, 10 Nov 2004 05:31:04 -0800

Jorge:

Thanks for your help. Can you clarify the following questions?

1. I understand the use of "|"; it's an "or". I see that you are saying
"(any alpha or number)" or "+" or "-". I don't understand "\(_)". Why can't I
say \_. What is the significance of the open and close paranthesis?

2. Also, this does not seem to enforce Rule 1 concering the minimum and the
maximum length.

Thanks.

Venkat

"Jorge Serrano [MVP VB]" wrote:

> Hi wenk,
>
> try the next regular expression:
> ^([a-zA-Z0-9|\+|\-\(_)]{3,20})$
>
> (test it first please)
>
> I hope that helps.
>
> Kind Regards,
>
> Jorge Serrano
> MVP VB.NET
>
>
> "vvenk" wrote:
>
> > Hello:
> >
> > I am trying to learn about regular expressions.
> >
> > How would I use regular expressions to ensure that the password an user
> > enters conforms to the following rules:
> >
> > 1. It has to be between 3-20 characters long.
> > 2. Only a-z, A-Z, 0-9, +-_ are allowed.
> > 3. At least one occurence of a lower case letter, a upper case letter and a
> > digit has to be used.
> >
> > Any help will be appreciated.



Relevant Pages

  • [NEWBIE] newline question
    ... and replaces certain occurences in text files via regular expressions. ... clarify it for me. ... The original perl script looks like this: ...
    (comp.lang.perl.misc)
  • Re: if with or
    ... The brackets are not required, but I find they clarify what is being ... Or possibly look at Regular Expressions if the patterns are more ...
    (microsoft.public.excel.programming)
  • Re: Format string using regular expressions
    ... Regular expressions are used to parse strings, not to format them. ... you clarify why you think you need them here? ...
    (microsoft.public.dotnet.framework)
  • RE: Newbee question on regular expressions
    ... Kind Regards, ... Jorge Serrano ... MVP VB.NET ... > I am trying to learn about regular expressions. ...
    (microsoft.public.dotnet.languages.vb)