Optional left parenthesis regex error

I'm not a regex expert and can't figure out what I should change here.

I am getting these two errors

Raw left curly brace in regex is deprecated, missing in regex; marked <-- HERE

in m/^(.*?)(\\)?\${ <-- HERE ([^{}]+)}(.*)$/

at / usr / share / perl 5 / Debconf / Question.pm line 72.

Raw left curly brace in regex is deprecated, missing in regex; marked <-- HERE

in m/\${ <-- HERE ([^}]+)}/

on / usr / share / perl 5 / Debconf / Config.pm line 30.

When I go to line 72 this is what I see

while ($rest =~ m/^(.*?)(\\)?\${([^{}]+)}(.*)$/sg) {

      

+3


source to share


1 answer


This is a failure warning indicating that the code will stop working in the future.

If you want to match exactly {

, you should avoid it.



In other words, you can fix the problem (disable the warning) by replacing the first one {

with \{

.

+6


source







All Articles