Page MenuHomePhabricator

Template matching regex features only matches prefix
Open, LowestPublic

Description

In https://github.com/wikimedia/articlequality/pull/115, @Helder noticed that template matching regexes only match a prefix and thus matching r"Carece de fontes2", would pick up both {{Carece de fontes2}} and {{Carece de fontes2/doc}}.

We could manually add "$" to the end of every regex to control this or maybe matching the end of the string should become the default behavior in revscoring. Alternatively, we can add a param to our regex-matching methods that would specify when regexes should match all the way to the end of a template name or not.