in reply to Regex keeps looping on itself :/
You could something along these lines instead:
$post_message =~ s{\[\[([^]]+)\]\]}{process_match($1)}ge; sub process_match { my $tmp = shift; if ($DB->table('Articles')->count( { article_title => $tmp } ) > 0) + { # return modified text here } else { return $tmp; # unmodified text } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex keeps looping on itself :/
by ultranerds (Hermit) on Jun 18, 2009 at 14:41 UTC |