boazsender/jQuery-Twitter-Plugin — Issue #19: RegExp passed to replace as string
Author: rexmac
Created: 2012-02-23 13:36:56+00:00
State: open

The`mention` and `hashtags` methods pass a regex string to `str.replace`. Shouldn't those be RegExp objects, i.e. unquoted? In their current form, the functions do not work as the substring is never matched. Once the quotes are removed, the functions perform as expected.

Also, as the `i` modifier is being used, is it really necessary to have both `A-Z` and `a-z` character classes in the regex?

If I have time, I'll fork, make these changes, and send a pull request. Also, it seems there are no unit tests for those functions. I'll see if I can come up with those as well.