The motivation for this request is the following task:
A user creates a named reference (e.g. <ref name="something">...</ref>) and uses it throughout a page (e.g. <ref name="something"/> ...). Later, another user edits the page, and removes the first definition of that named reference. This causes all subsequent uses to return an error.
The idea is to create an abuse filter that can (a) detect when a named reference is removed, (b) detect that value of the "name" parameter of that reference, and (c) check to see if any other reference tags using the same name parameter exist throughout the page.
Parts a and c are very easy. Part b is only possible if you can store the output of a regular expression match into a variable. Currently, the only regex function allowed by AbuseFilter is rcount, which doesn't serve this purpose.