Page MenuHomePhabricator

Support regex queries in TextMatchEditCheck
Open, Needs TriagePublic

Description

Another improvement to TextMatchEditCheck: allow individual rules to have regex queries.

Event Timeline

For context, TextMatch uses ve.dm.Document's findText method to locate matches (the same method that backs up the find/replace toolbar in VE), and this already supports regular expressions. This ticket is, as much as anything, about deciding how the config should represent regular expressions, and wiring up actually creating the RegExp instance to pass in.

Looks great! A few hours late, but I wonder if it could be possible to integrate regular expressions to the rules? For example, we currently have:

	"stands as a testament",
	"stands as a reminder",
	"serves as a testament",
	"serves as a reminder",
	"is a testament",
	"is a reminder",

Would it be more future-proof to have a single rule "(stands as|serves as|is) a (testament|reminder)"? This would also allow us to include phrasal templates in the list, which are much more prevalent as tells in more recent models (GPT-5 for instance), while individual words/phrases were more commonplace in earlier models.