use strict;
my $str = '//define(\'WP_CACHE\', true); //Added by WP-Cache Manager';
my $regex = qr/(?<!\/\/)\s*define\s*\(\s*([\'"])WP_CACHE\1\s*,\s*(?:\-?[1-9][0-9\.]*|TRUE|([\'"])(?:[^0\'"]|[^\'"]{2,})\2)\s*\)\s*/ip;
my $subst = '';
my $result = $str =~ s/$regex/$subst/r;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html