This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes regular pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "regular pattern" Watch "regular pattern" New topic
Author

regular pattern

Parashuram Hallur
Ranch Hand

Joined: Sep 18, 2006
Posts: 41
Hi,

I am looking for regular pattern which will check for the characters
0-9a-zA-Z and '_' and non-ascii characters

If the input string contains any of the above characters should be allowed. Essentially I want to restrict only special characters but not non-ascii.

Thanks for any help

Regards
Parash
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
Try:

[0-9a-zA-Z_']


or better still, read this Regex tutorialtutorial


Who dares, wins! (SAS motto)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: regular pattern
 
Similar Threads
Politically Correct: I Can't Say Anything Anymore
images
Binary files
How to make sure a file is a valid text file.
regex Pattern class and spaces