Created
May 30, 2015 17:17
-
-
Save JFriel/ecd4195bf9030e037e83 to your computer and use it in GitHub Desktop.
This file contains 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
port org.jsoup.Jsoup; | |
String html = "bfbvfvbrbvb <div id='adressscroll'> G74 4GX</div>"; | |
Pattern pattern = Pattern.compile("[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}"); | |
Document doc = Jsoup.parse(html); | |
Element address = doc.select("div.adressscroll").first(); | |
String divString = address.html(); | |
Matcher matcher = pattern.matcher(davString); | |
if (matcher.find()){ | |
System.out.println(matcher.group(1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment