Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e067f048 authored by Tobias Sargeant's avatar Tobias Sargeant Committed by android-build-merger
Browse files

Merge "[webview] Fix handling of unicode digits in address detection." am:...

Merge "[webview] Fix handling of unicode digits in address detection." am: 8abff6b4 am: e71eaf3f am: dd702a3a
am: bac55271

Change-Id: Ieaa0a8da2eba7b0469b2ba707899818c1ccf0264
parents 4df5836c bac55271
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ class FindAddress {

    // A house number component is "one" or a number, optionally
    // followed by a single alphabetic character, or
    private static final String HOUSE_COMPONENT = "(?:one|\\d+([a-z](?=[^a-z]|$)|st|nd|rd|th)?)";
    private static final String HOUSE_COMPONENT = "(?:one|[0-9]+([a-z](?=[^a-z]|$)|st|nd|rd|th)?)";

    // House numbers are a repetition of |HOUSE_COMPONENT|, separated by -, and followed by
    // a delimiter character.
@@ -253,10 +253,10 @@ class FindAddress {
            Pattern.CASE_INSENSITIVE);

    private static final Pattern sSuffixedNumberRe =
            Pattern.compile("(\\d+)(st|nd|rd|th)", Pattern.CASE_INSENSITIVE);
            Pattern.compile("([0-9]+)(st|nd|rd|th)", Pattern.CASE_INSENSITIVE);

    private static final Pattern sZipCodeRe =
            Pattern.compile("(?:\\d{5}(?:-\\d{4})?)" + WORD_END, Pattern.CASE_INSENSITIVE);
            Pattern.compile("(?:[0-9]{5}(?:-[0-9]{4})?)" + WORD_END, Pattern.CASE_INSENSITIVE);

    private static boolean checkHouseNumber(String houseNumber) {
        // Make sure that there are at most 5 digits.