import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "^\\x7f?\\x7e?\\x7d?\\x7c?\\x7b?z?y?x?w?v?u?t?s?r?q?p?o?n?m?l?k?j?i?h?g?f?e?d?c?b?a?`?\\x5f?\\x5e?\\x5d?\\x5c?\\x5b?Z?Y?X?W?V?U?T?S?R?Q?P?O?N?M?L?K?J?I?H?G?F?E?D?C?B?A?@?\\x3f?\\x3e?\\x3d?\\x3c?\\x3b?\\x3a?9?8?7?6?5?4?3?2?1?0?\\x2f?\\x2e?\\x2d?\\x2c?\\x2b?\\x2a?\\x29?\\x28?\\x27?\\x26?\\x25?\\x24?\\x23?\\x22?\\x21?\\x20?$";
final String string = "ae\n"
+ "ea\n"
+ "za\n"
+ "aA\n"
+ "f$\n";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html