Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Regular Expression Format Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Regular Expression Format Help" Watch "Regular Expression Format Help" New topic
Author

Regular Expression Format Help

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi,
I have the below requirement.
Do not allow I or O in a particular text box.

I thought of having the client side validation with the regular expression pattern.
But i am not able to figure out an expression for this.

Any help would be appreciated.

Thanks
Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129
I'm no expert, but I would probably use something like:

[A-HJ-Z] <-- EDIT: ignore this, it's stupid, sorry. See my next post...

Or is that overly simple?

Two resources that I always find very useful:
Regular Expressions Cheat Sheet
Just has some handy reminders about syntax for regular expressions.

Online RegEx Tester
Tests your regular expressions, to allow you to iteratively improve them.

Dave.
[ January 08, 2008: Message edited by: David Payne ]
Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129
Sorry - that was a stupid answer, and I regret it...

What about just:

[IO]

This will tell you whether either I or O appears in the text box.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regular Expression Format Help
 
Similar Threads
how to remove the [[ from arraylist
How can I add error handling facilities to this code?
Validating The Date String
Regular Expression
regular expression which doesnt alllow *