tags:

views:

52

answers:

1

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

Any advise?

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

    //Wold this execute properly, this really is the extent of my question? 
    preg_match($i, $string);
+1  A: 

Regular expressions are simply strings, so you could store them as such in your database.

Shakedown
Well I know I can store them, I am just wondeirng how to build regex functions dynamically with php and the fuction in a variable string.
@adbox Explain what you mean by this and provide some examples, and edit your post with such info.
Shakedown