This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am not verry good in regular expressions and try to remove the character which looks like a square or a rectangle form a String. But I really do not know how to do that. I know that since JDK 1.4 regular expressions are in the package but how do I express this character? It is a non ASCII character and I am not able to paste it here. I have to send this String using SOAP and during the data encryption the server crashes. Is there a way to remove all non ASCII characters from a String or has someone an other adivce?
A regular expression, also known as a regex or regexp, is a string whose pattern (template) describes a set of strings. The pattern determines what strings belong to the set, and consists of literal characters and metacharacters, characters that have special meaning instead of a literal meaning. The process of searching text to identify matches�strings that match a regex's pattern�is pattern matching.
Java's java.util.regex package supports pattern matching via its Pattern, Matcher, and PatternSyntaxException classes:
Pattern objects, also known as patterns, are compiled regexes
Matcher objects, or matchers, are engines that interpret patterns to locate matches in character sequences, objects whose classes implement the java.lang.CharSequence interface and serve as text sources