📜  在 java 代码示例中使用正则表达式拆分字符串

📅  最后修改于: 2022-03-11 14:52:25.813000             🧑  作者: Mango

代码示例1
String current_url = "https://{domain name}/{type of data}/4583236-{name-of-perpetrators}";
    String[] urlParts = current_url.split("type of data}/");
    String mySuburl = urlParts[1];
    String[] suburl = mySuburl.split("-{name-of-perpetrators");
    String mytext = suburl[0];
    System.out.println(mytext);