opto / nostalgy-xpi

nostalgy addon updated for Thunderbird 68 and now Thunderbird 78 - 115. Original code by Alain Frisch.
Other
119 stars 9 forks source link

What flavor of RegEx does nostalgy++ use #183

Open cjholly opened 2 years ago

cjholly commented 2 years ago

This may not be the right question, but I have tried various expressions in Rules with no success. I am trying to create a rule that looks at the subject line for Jesse X. James, Jesse James, James, Jesse X. and so on.

Do the rules support RegEx? And if so, does anyone know how to accomplish this? It seems trivial, but it is not playing out that way for me. I did make sure the match beginning of folder setting was not set --Chris

opto commented 1 year ago

that may have been lost when the search for multiple expressions in one string was introduced? It might need a new pref to have either one or the other?

opto commented 1 year ago

the code uses the aaa = new RegExp()

Does that help? google for regexp() probably answers your question

opto commented 1 year ago

ah ... do rules use this?

this is the match criterion: function NostalgyMatchContains(field, contain) { var re = /^\/(.*)\/$/; if (contain.match(re)) { var m = re.exec(contain); var re = RegExp(m[1], ""); return field.match(re); }

does that help?