Created
November 9, 2015 16:16
-
-
Save grational/4d2a02003ff04b552155 to your computer and use it in GitHub Desktop.
Extract central field of the landing url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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