I am learning about Java regexes, and I noticed the following operator:
\\*1
I'm having hard time figuring out what it means (searching in the web didn't help). For example, what is the difference between these two options:
Pattern p1 = Pattern.compile("(a)\\1*"); // option1
Pattern p2 = Pattern.compile("(a)"); // option2
Matcher m1 = p1.matcher("a");
Matcher m2 = p2.matcher("a");
System.out.println(m1.group(0));
System.out.println(m2.group(0));
Result:
a
a
Thanks!