File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Need Regular Expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need Regular Expression" Watch "Need Regular Expression" New topic
Author

Need Regular Expression

kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Hi,

In my code i have a string.
Now in this string i need to print a warning message, if contains
any character other than (A-Z,a-z,0-9,_)

I tried to do with contains([A-Za-z0-9_])and pattern().
But could not get through.

Where am i doing mistake. Can you please point it out..

Tahnks,
Kaya.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19679
    
  18

Check the API of java.util.regex.Pattern. It clearly specifies how to create an "Any character except" character class.


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: Need Regular Expression