File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 19541
    
  16

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
 
Similar Threads
regular pattern
pattern Match without using Pattren or RegulaExpression
How to check whether the string contains only the specified characters?
How to find if there is a number in a string using regular expressions.
Can you simulate String.replace(...) & String.contains(...)