Skip to content

RegExp passed to replace as string #19

@rexmac

Description

@rexmac

Themention 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions