I'm attempting to do the following:
Scanner scanner = new Scanner(file);
StringBuilder sb = new StringBuilder();
while (scanner.hasNextLine()) {
sb.append(scanner.nextLine() + "\n");
}
String data = sb.toString();
Pattern p = Pattern.compile("\b[ABD-Z]*C[ABD-Z]*\b");
Matcher m = p.matcher(data);
String a = m.group();
How do I access the results of m? Why is my RegEx not working?
I have tried escaping backslashes already.
It works on http://www.gskinner.com/RegExr/ but I can't get any output from Java.
Please help≥.. thanks.
\\binstead of\bunless you mean the backspace character.