import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "redirect_url%2522%253A%2522([^>]+)%252F%253F";
final String string = "https://ue.flipboard.com/usage?data=%257B%2522prod_type%2522%253A%2522notification%2522%252C%2522event_category%2522%253A%2522email%2522%252C%2522event_action%2522%253A%2522click%2522%252C%2522event_data%2522%253A%257B%2522type%2522%253A%252210today.ad3li.20200116.421.1%2522%252C%2522target_id%2522%253A%2522art5678910%252F0%2522%252C%2522url%2522%253A%2522https%253A%252F%252Fwww.washingtonpost.com%252Fgraphics%252F2020%252Fentertainment%252Fnotre-dame-history%252F%2522%252C%2522method%2522%253A%2522externalweb%2522%252C%2522redirect_url%2522%253A%2522https%253A%252F%252Fwww.washingtonpost.com%252Fgraphics%252F2020%252Fentertainment%252Fnotre-dame-history%252F%253Futm_medium%253D10today.ad3li.20200116.421.1%2526utm_source%253Demail%2526utm_content%253Darticle%2526utm_campaign%253D10-for-today---4.0-styling%2522%257D%252C%2522properties%2522%253A%257B%2522uid%2522%253A%25224141481%2522%252C%2522unique_id%2522%253A%25224141481%2522%252C%2522time%2522%253A1579245285471%252C%2522ab_tests%2522%253A%2522421_1%2522%257D%257D";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html