It will *happen* to work for some invalid inputs. Here are cases that support what I said:
Non-letters in $repl:
my $find= "find"; my $repl= "@@@@"; $_ = "Find"; print; s/\b($find)\b/ uc($repl) | ( $1 ^ uc($1) ) /eig; print; # @``` # Should be @@@@
Non-letters in $find:
my $find= chr(1234) . 'find'; my $repl= "aaaaa"; $_ = chr(1234) . 'FiNd'; print; s/\b($find)\b/ uc($repl) | ( $1 ^ uc($1) ) /eig; print; # AAaAa # Should be aAaAa
In reply to Re^3: Respect case in substitution
by ikegami
in thread Respect case in substitution
by b4swine
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |