Toomas Vendelin writes:
> In the following chunk of PlPerl code the date doesn't match the regex:
> my $endby = '2009-06-13';
> my $t = spi_exec_query(qq|SELECT CASE WHEN '$endby' ~ E'.*\\d\\d\\d\\d
> \\-\\d\\d?\\-\\d\\d?.*'
> THEN '$endby'::timestamptz ELSE CURRENT_DATE::timestamptz EN
How should one escape regular expressions in plperl?
In the following chunk of PlPerl code the date doesn't match the regex:
my $endby = '2009-06-13';
my $t = spi_exec_query(qq|SELECT CASE WHEN '$endby' ~ E'.*\\d\\d\\d\\d
\\-\\d\\d?\\-\\d\\d?.*'
THEN '$endby'::timestamptz ELSE CURRENT_D