I am having trouble learning this piece of regex. can an expert help please.
The posting says
String pattern = "(?i)(<title.*?>)(.+?)(</title>)";
String updated = EXAMPLE_TEST.replaceAll(pattern, "$2");
will extract the content of the <title>, which does work out that way.
Please explain what is the (?i)? isn't this suppose to be group 1? which then make the content part group 3, but yet the result does pick out the content directly. By content I mean the text between beg and end title tag.
next, what difference does it make to have ? at the end of (.+?)? w/o the end ?, how would the result be any different?