Skip to content

Modify Cashtag regex #39

Merged
merged 1 commit into from Aug 2, 2012
+4 −2
View
6 src/com/twitter/Regex.java
@@ -170,6 +170,8 @@
public static final Pattern VALID_TCO_URL = Pattern.compile("^https?:\\/\\/t\\.co\\/[a-z0-9]+", Pattern.CASE_INSENSITIVE);
public static final Pattern INVALID_URL_WITHOUT_PROTOCOL_MATCH_BEGIN = Pattern.compile("[-_./]$");
- public static final Pattern VALID_CASHTAG = Pattern.compile("(?:^|" + UNICODE_SPACES + ")" + DOLLAR_SIGN_CHAR + "(" + CASHTAG + ")" +"(?=$|\\s|\\p{Punct})", Pattern.CASE_INSENSITIVE);
- public static final int VALID_CASHTAG_GROUP_CASHTAG = 1;
+ public static final Pattern VALID_CASHTAG = Pattern.compile("(^|" + UNICODE_SPACES + ")(" + DOLLAR_SIGN_CHAR + ")(" + CASHTAG + ")" +"(?=$|\\s|\\p{Punct})", Pattern.CASE_INSENSITIVE);
+ public static final int VALID_CASHTAG_GROUP_BEFORE = 1;
+ public static final int VALID_CASHTAG_GROUP_DOLLAR = 2;
+ public static final int VALID_CASHTAG_GROUP_CASHTAG = 3;
}
Something went wrong with that request. Please try again.