Refactoring

This commit is contained in:
M66B 2022-02-16 16:07:25 +01:00
parent c4c8963f23
commit 7e4f975edb
1 changed files with 6 additions and 3 deletions

View File

@ -1355,11 +1355,14 @@ public class HtmlHelper {
// tel:<phonenumber> // tel:<phonenumber>
final Pattern GPA_PATTERN = Pattern.compile("GPA\\.\\d{4}-\\d{4}-\\d{4}-\\d{5}"); final Pattern GPA_PATTERN = Pattern.compile("GPA\\.\\d{4}-\\d{4}-\\d{4}-\\d{5}");
final Pattern pattern = Pattern.compile( final Pattern pattern = Pattern.compile(
"(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")|" + "(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")" +
"|" +
PatternsCompat.AUTOLINK_WEB_URL.pattern() PatternsCompat.AUTOLINK_WEB_URL.pattern()
.replace("(?i:http|https|rtsp)://", .replace("(?i:http|https|rtsp)://",
"(((?i:http|https)://)|((?i:xmpp):))") + "|" + "(((?i:http|https)://)|((?i:xmpp):))") +
"(?i:geo:\\d+,\\d+(,\\d+)?(;u=\\d+)?)|" + "|" +
"(?i:geo:\\d+,\\d+(,\\d+)?(;u=\\d+)?)" +
"|" +
"(?i:tel:" + Patterns.PHONE.pattern() + ")" + "(?i:tel:" + Patterns.PHONE.pattern() + ")" +
(BuildConfig.DEBUG ? "|(" + GPA_PATTERN + ")" : "")); (BuildConfig.DEBUG ? "|(" + GPA_PATTERN + ")" : ""));