Java - general

regular expressions

Here a little extract out of the possibilities of regular expressions (regular expressions):



If you do not want special characters to be interpreted as control characters, but as normal signs, you must add „\“ as a prefix (in Java-String you have to input a double „\\“).

A little Java-example:

String str = "hello.txt";
System.out.println(str.matches("^hello\\..*"));  // true; corresponds to a "hello.*"


Detailed information (in engl.) at this page:
http://www.regular-expressions.info