Permalink
Browse files

modify Cashtag regex

  • Loading branch information...
1 parent 5f0d568 commit 3bb33e9c734438d38640956680790c0b8f623797 @keitaf keitaf 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 3bb33e9

Please sign in to comment.