Did not work when i keyed in this >>> basd112!
using the regex >> ^[A-La-l][a-zA-Z1-9].+
Main Topics
Browse All TopicsI have a problem with regex. I am using the jakarta regex as opposed to the one bundled with JDK.
I have to check in a character sequence that
(a) First Letter should be between A-L(case does not matter)
(b) Followed by that it should only have a-z or 1-9 (case for does not matter)
Valid is like b1sdfghj
Invalid is like m1bshdk >> this one starts wrongly
b1sdfg&q >> this has special character
Thanx a lot in advance,
RK
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
- If you meant
(a) First Letter should be between A-L (case does not matter)
(b) Followed by ONE OR MORE time the characters a-z or 1-9 (case does not matter)
Then indeed the regex to use is
^[A-La-l][a-zA-Z1-9]+
- If you meant
(a) First Letter should be between A-L (case does not matter)
(b) Followed by ZERO OR MORE times the character a-z or 1-9 (case does not matter)
Then the regex to use is
^[A-La-l][a-zA-Z1-9]*
Perl5 and it is in a struts file.
I will post you the snippet ...
<field property="userId" depends="required,mask">
<arg0 name="required" key="Login Id " resource="false" />
<msg name="mask" key="logon.userid.maskmsg"
<var>
<var-name>mask</var-name>
<var-value>^[A-La-l][a-zA-
</var>
</field>
Well, if at http://jakarta.apache.org/
I enter as Perl5 expression: ^[A-La-l][a-zA-Z1-9]+
and as SearchInput : alasdf!
I get: The input IS NOT an EXACT match
while I get "The input IS an EXACT match." for: alasdf
>> this expression should be fine
That's indeed what http://jakarta.apache.org/
Business Accounts
Answer for Membership
by: CEHJPosted on 2005-06-08 at 13:49:26ID: 14174568
Match
"^[A-La-l][a-zA-Z1-9].+"
or find
"^[A-La-l][a-zA-Z1-9]"