Perl : Quantifier follows nothing in regex; marked by

Error in replacing string with Perl, it’s time to investigate our English! Quantifier means a quantifier. The reason is that we use variables as matching pattern strings, which contain quantifiers, resulting in recognition errors. How to solve it?In fact, we can completely replace functions with strings instead of regular replacement. Unfortunately, Perl doesn’t seem to have a string replacement function! Fortunately, we found an example of the string wrapped by the pattern string: [pl] # if the pattern string adopts the variable method and the quantifier appears in the variable, the error sub testquantityerror {my $STR = – he * LLO} will appear; my $match = “e*” ; #$ match =~ s/\*/\\*/ ; In the previous method, replace the quantifier, but this will change the source string, not if ($STR = ~ m/\ q $match/E /) {print “match”;}}[/ pl]

Similar Posts: