You can just change the preg_match to work with any other engine. Just change the q to the name of the variable.