Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #39 from twitter/modify_cashtag_regex
Browse files Browse the repository at this point in the history
Modify Cashtag regex
  • Loading branch information
psychs committed Aug 2, 2012
2 parents 5f0d568 + 3bb33e9 commit 212b70b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/com/twitter/Regex.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ public class Regex {
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.