Hi Guys,
I have found solutions for the first two:
1. Regular expression for "String must contain
lowercase uppercase
numbers and at least one spe-cial char
(!£$%&*#+-<>)":
regex:
^(?=.*d)(?=.*[a-z])(?=.*[A-Z])(?=.*[<>!#$&
-+%*]).*$
2. Regular expression for "The first n characters must
include a
special char".
regex: ^w{0,3}(?=W{1,4}).*$
Now, for the 3rd one I got one solution which still doesn't
fullfil my
purpose. For example assume the following words to build the
regular
expression: "First 8 character must include 'dav'
". The expression
that I came up with is following:
^w{0,5}(?=(dav)).*$
The expression works fine. The only problem is we need to do
some
calculation here. For {0,5}, here 5 comes from the equation
{8 -
Length(dav)3}. My problem is here dav is a username which
may change
always at runtime. So I actualy require an expression which
will
specify the exact number of character without any math {0,8
in my
example}.
Can any one help me on this.
Regards,
Mosfiqur Rahman
On Oct 15, 2:24 pm, "Mosfiq" <mosfi... gmail.com> wrote:
> Hi Everyone,
> I'm new to Regular expressions. I need individual
regular expressions
> for each item below:
> 1. Regular expression for "String must contain
lowercase uppercase
> numbers and at least one spe-cial char
(!£$%&*#+-<>)".
> 2. Regular expression for "The first n characters
must include a
> special char".
> 3. Regular expression for " First 8 characters
must not be 'mosfiq' ".
>
> Is there anyone who can help me on creating these three
regular
> expressions.
>
> Thanks in Advance.
> Regards.
> Mosfiqur Rahman
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://grou
ps-beta.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|