Are you getting a script error or just unexpected results?
In reply to Re: passing a regex to a sub by Praethen in thread passing a regex to a sub by mark4444az