I am trying to capture text that is matched by lookbehind.
My code :
private static final String t1="first:\\\w*";
private static final String t2="(?<=\\w+)=\\".+\\"";
private static final String t=t1+'|'+t2;
Pattern p=Pattern.compile(t);
Matcher m=p.matcher("first:second=\\"hello\\"");
while(m.find())
System.out.println(m.group());
The output:
first:second
="hello"
I expected:
first:second
second="hello"
How can I change my regex so that I could get what I expect.
Thank you