Skip to content
Browse files

Update Mention regex to include att [Rr][tT] variations

This commit is actually based on a pull request for the conformance
suite.
twitter/twitter-text-conformance#58
As shown there twitter actually recognizes a mention no matter
what variation of "RT/rt/Rt/rT" preceeds it.
This commit was done on the dime of Simply Measured simplymeasured.com
  • Loading branch information...
1 parent 0654255 commit f992e4fef347c083df275b15b7514917371fc94d @kungfumike committed Sep 13, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/twitter-text/regex.rb
View
2 lib/twitter-text/regex.rb
@@ -168,7 +168,7 @@ def self.regex_range(from, to = nil) # :nodoc:
# Used in Extractor for final filtering
REGEXEN[:end_hashtag_match] = /\A(?:[##]|:\/\/)/o
- REGEXEN[:valid_mention_preceding_chars] = /(?:[^a-zA-Z0-9_!#\$%&*@@]|^|RT:?)/o
+ REGEXEN[:valid_mention_preceding_chars] = /(?:[^a-zA-Z0-9_!#\$%&*@@]|^|[rR][tT]:?)/o
REGEXEN[:at_signs] = /[@@]/
REGEXEN[:valid_mention_or_list] = /
(#{REGEXEN[:valid_mention_preceding_chars]}) # $1: Preceeding character

0 comments on commit f992e4f

Please sign in to comment.
Something went wrong with that request. Please try again.