Alex Rivera | Logout

Replacing all non-alphanumeric characters with empty strings

Asked 2009-11-26T20:28:42.157
238

I tried using this but didn't work-

return value.replaceAll("/[^A-Za-z0-9 ]/", "");
Edit
Report

1 Answer

12

Java's regular expressions don't require you to put a forward-slash (/) or any other delimiter around the regex, as opposed to other languages like Perl, for example.

answered 2009-11-26T20:39:19.917

Your Answer