Sounds like your doing the same as in this Txet Maglning Glof, Ayobndy? thread.
In reply to Re: Executing a function within a regex by BrowserUk in thread Executing a function within a regex by wolis