WL-3017 take two

Now uses regular expressions :? The commit order is designed to make it easy to set up a patch against the Sakai code base. :honeybee: