J
James
I`m trying to use regex to match/replace a word in parentheses.
The regular expression
private static final Pattern java_proc =
Pattern.compile("(java)");
does not work, because parentheses are treated as groupings.
Using "\" to designate the parentheses as literal characters does
not work --- not sure why:
private static final Pattern java_proc = Pattern.compile("\(java
\)");
I searched for and read a related post here, but it did not
help. I seem to be having a different problem than they. Or I just
don`t understand the post.
What am I doing wrong? Thanks, Alan
The regular expression
private static final Pattern java_proc =
Pattern.compile("(java)");
does not work, because parentheses are treated as groupings.
Using "\" to designate the parentheses as literal characters does
not work --- not sure why:
private static final Pattern java_proc = Pattern.compile("\(java
\)");
I searched for and read a related post here, but it did not
help. I seem to be having a different problem than they. Or I just
don`t understand the post.
What am I doing wrong? Thanks, Alan