Since there hasn't yet been a solution posted using lookarounds, here is one:
use strict; use warnings; use Test::More tests => 1; my $have = '0x388c818ca8b9251b393131c08a736a67ccb19297'; my $want = '0x388c ... b19297'; $have =~ s/(?<=^.{6}).*(?=.{6}$)/ ... /; is $have, $want;
Note that I probably would not do this in production and would instead use a substr-based approach.
🦛
In reply to Re: remove chars with regex
by hippo
in thread remove chars with regex
by frank1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |