aspose file tools*
The moose likes Java in General and the fly likes Reg. Expr. using Pattern - Invalidate a String, if it contains certain characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reg. Expr. using Pattern - Invalidate a String, if it contains certain characters" Watch "Reg. Expr. using Pattern - Invalidate a String, if it contains certain characters" New topic
Author

Reg. Expr. using Pattern - Invalidate a String, if it contains certain characters

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
I admit that I am not good with regular expression. If any of you is good with regular expression, could you please suggest a pattern that will help me?

This is the problem statement:
If an input String contains any of the following 16 characters (e.g. !, @, =, etc.) that that input String is invalid.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Check out character classes on the java.util.regex.Pattern Javadoc page.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg. Expr. using Pattern - Invalidate a String, if it contains certain characters