splitting a string with regex in java

Solutions on MaxInterview for splitting a string with regex in java by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "splitting a string with regex in java"
Giovanni
23 Jun 2018
1    String current_url = "https://{domain name}/{type of data}/4583236-{name-of-perpetrators}";
2    String[] urlParts = current_url.split("type of data}/");
3    String mySuburl = urlParts[1];
4    String[] suburl = mySuburl.split("-{name-of-perpetrators");
5    String mytext = suburl[0];
6    System.out.println(mytext);
7