import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "\\.(?>post|put|get|patch|delete|head|options)\\((?>[\\\"\\']?)(\\/?api(?>\\/\\w+){0,}\\/?)\\w+";
final String string = "\", \"/api/bike/portal/available/hours\", \"/api/bike/portal/business/status\", \"/api/bike/portal/earnings/aggregate\", \"/api/bike/portal/roles/profile\"],\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:4402: return this.httpClient.get(\"/api/bike/portal/lastseens/bikecompany/\" + l)\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:4407: }).join(\",\"))), e.length && (t = t.set(\"businessStatus\", e.join(\",\"))), this.httpClient.get(\"/api/bike/portal/bikeCompany/\" + l + \"/businesss/lastseens\", {\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:4411: return this.httpClient.get(\"/api/bike/portal/\" + l + \"/metadata/dcts\")\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:6299: return this.httpClient.post(\"/api/bike/portal/switching/business/noc/accept\", {\n"
+ "this.httpClient.get(\"/api/bike/portal/\" + l + \"/\" + n + \"/profile\")\n"
+ "post(\"/api/bike/portal/\" + l + \"/email/verification/response\", {\n"
+ ".get(\"/api/bike/portal/\" + l + \"/invoices\")\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:6709: return this.httpClient.delete(\"/api/bike/portal/\" + l + \"/invoices/\" + n + \"/download-link\", {\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:7357: return this.httpClient.put(\"/api/bike/portal/earnings/cycles/\" + l + \"/partial\", {\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:7362: return this.httpClient.head(\"/api/bike/portal/business/acceptance/\" + l, {\n"
+ ".//2022101152_16.b89695434a4e47b29104.js:7367: return this.httpClient.options(\"/api/bike/portal/available/hours/\" + l, {";
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