Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
say for example I would like to store regular expressions in a database in a way I would use it in a web form to check for valid user input for a form element.
Let's say I have my expression stored in a varchar column like this: /[a-z]/i
When I now retrieve that from the database and have the expression stored in a scalar $regex - How would I be able to use it in my code to match it against some $text?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Storing regexen in a DB and using them
by kennethk (Abbot) on Jan 27, 2014 at 15:33 UTC | |
|
Re: Storing regexen in a DB and using them
by davido (Cardinal) on Jan 27, 2014 at 17:29 UTC | |
|
Re: Storing regexen in a DB and using them
by TomDLux (Vicar) on Jan 27, 2014 at 15:32 UTC | |
|
Re: Storing regexen in a DB and using them
by FloydATC (Deacon) on Jan 28, 2014 at 11:42 UTC |