The output I would like to see is: temp = 0
As whatever matches will be replaced, just include those 6 characters in the search pattern:
$temp =~ s/$pattern\w{6}//i;
As for the inversion, see reverse.
In reply to Re^3: Regex - remove characters (pattern not terminated)
by almut
in thread Regex - remove characters (pattern not terminated)
by twaddlac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |