Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Detect special character from a String

800332Jul 26 2010 — edited Jul 30 2010
Hello guys,

Some of the files in unix box contain special characters . I need to strip these special character in the filename to underscore. however, I do not want to strip off special character like _ - ^ . @

Pattern escaper = Pattern.compile("([^a-zA-z0-9_-^.@])");

I couldn't strip off the caret. Appreciate any advice please. Thanks in advance!

Cheers,
Mark
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2010
Added on Jul 26 2010
19 comments
2,460 views