Rewrite regex for project names to be not prone to catastrophic backtracking
Summary: Fixes T15371
Test Plan:
- Save the text {{#translation:}} in remarkup and see that it renders.
- Create a project or projects with the hashtags a, b, ab, foo, f.o.o.
- Observe that both before and after this patch you can link to all of them by hashtag.
- Create a project or projects with the hashtags a., .b, .foo, foo..
- Observe that both before and after this patch you can link to none of them by hashtag.
Reviewers: O1 Blessed Committers, aklapper
Reviewed By: O1 Blessed Committers, aklapper
Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15371
Differential Revision: https://we.phorge.it/D25838