Skip to content

Instantly share code, notes, and snippets.

@grational
Created November 9, 2015 16:16
Show Gist options
  • Save grational/4d2a02003ff04b552155 to your computer and use it in GitHub Desktop.
Save grational/4d2a02003ff04b552155 to your computer and use it in GitHub Desktop.
Extract central field of the landing url
import java.util.regex.Matcher;
import java.util.regex.Pattern;
String input = "https://test-landing.seat.it/Ristoranti_di_SCHIRALLI_ANTONIO_14b9/home.html";
//Extract services
final Pattern landingPattern = Pattern.compile(":\\/\\/.*\\/(.*)\\/");
Matcher m = landingPattern.matcher(input);
if(m.find()) {
System.out.println(m.group(1)); // print Ristoranti_di_SCHIRALLI_ANTONIO_14b9
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment