Can I store and call regex in variables for later use?

Posted by adbox on Stack Overflow See other posts from Stack Overflow or by adbox
Published on 2010-03-19T00:10:20Z Indexed on 2010/03/20 16:21 UTC
Read the original article Hit count: 253

Filed under:

I plan on storing regular expression codes in a database, but not sure how to get them from variable to function.

advise?

$i = "([wx])([yz])" 
$j = "[^A-Za-z0-9]" 
$k= "([A-Z]{3}|[0-9]{4})"

    //Wold this execute properly, this really is the extend of my question? 
    preg_match($i, $string);

© Stack Overflow or respective owner

Related posts about regex