I use FiltaQuilla regex match to match whole words in subjects, with regex such as:
/(^|[^A-Za-z])myword([^A-Za-z]|$)/i
This is very useful to match short acronyms in subjects without matching common words which would happen to include these acronyms (e.g. avoid matching "NATO" in "denominator"), and without missing these acronyms when they appear at the start or end of a subject (which is the issue if you match on " XXX ", with spaces around the acronym).
But, since this regex syntax is quite heavy, unreadable and error prone, I wanted to suggest that it would be nice to add such type of whole word matching in subject as a matching criteria in itself. It could be named "Subject: whole word", with options such as "is contained", "is not contained", and followed by a field where the user would just have to enter the word to match.
In fact, I looked into a Javascript regexp tutorial, and there exists a shortcut to match word boundaries ( b ) ; and after some testing, it seems it properly consider special accented chars as part of the word, and start and end of subject as word boundaries.
Said differently, a better regexp as the one above is :
/bmywordb/i
Anyways, to make it more easily discoverable, it is still possibly worth being added as a specific criteria…?
That will be a fairly easy addition to FiltaQuilla. Thanks for suggesting it.
You've also got me thinking that it might be good to have "named" javascript custom filters. That is, since you can easily define the correct javascript for your filter, it should be easy to add a named javascript custom filter of your own that has that test in it, and could then be added like any other filter. I'd like to consider supporting that concept as well.
Recent Comments