ManFromNeptune has asked for the wisdom of the Perl Monks concerning the following question:
Is this possible? Any better ways to store/retrieve compiled regex?my $regex = "the (animals|dogs|cats).+?are ready to eat."; my $compiled_regex = qr/$regex/; # store $compiled_regex in a database # later on, retrieve the $compiled_regex_from_db my $compiled_regex_from_db = [DBI query and unserialize or thaw?]; my $teststring = "the dogs who are friendly are ready to eat."; $teststring =~ s/$compiled_regex_from_db/creatures/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: storing a qr// compiled regexp in a database?
by Corion (Patriarch) on Sep 17, 2005 at 21:05 UTC | |
by ManFromNeptune (Scribe) on Sep 17, 2005 at 21:16 UTC | |
by Corion (Patriarch) on Sep 17, 2005 at 21:18 UTC | |
by ManFromNeptune (Scribe) on Sep 17, 2005 at 21:52 UTC | |
by traveler (Parson) on Sep 18, 2005 at 17:55 UTC | |
|
Re: storing a qr// compiled regexp in a database?
by Anonymous Monk on Sep 17, 2005 at 21:27 UTC | |
by diotalevi (Canon) on Sep 18, 2005 at 03:18 UTC | |
|
Re: storing a qr// compiled regexp in a database?
by halley (Prior) on Sep 19, 2005 at 16:09 UTC | |
|
Re: storing a qr// compiled regexp in a database?
by samtregar (Abbot) on Sep 19, 2005 at 19:27 UTC |