Permalink
Browse files

Merge pull request #39 from twitter/modify_cashtag_regex

Modify Cashtag regex
  • Loading branch information...
2 parents 5f0d568 + 3bb33e9 commit 212b70b2906c3e9c9dcf4b58bc171d2937ef572a @psychs psychs committed Aug 2, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 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;
}

0 comments on commit 212b70b

Please sign in to comment.