frank1 has asked for the wisdom of the Perl Monks concerning the following question:
I need some help on removing the middle chars and leave the first 5 characters and last 5 characters using regex
i want this output
0x388c ... b19297but am getting this error Use of uninitialized value $_ in pattern match (m//)
my $char = "0x388c818ca8b9251b393131c08a736a67ccb19297"; my($output) = $char = /^(?<=\S{5})\S(?=\S{7})/; print $output;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: remove chars with regex
by ikegami (Patriarch) on Feb 26, 2025 at 14:15 UTC | |
by ForgotPasswordAgain (Vicar) on Feb 27, 2025 at 03:07 UTC | |
by ikegami (Patriarch) on Feb 27, 2025 at 11:18 UTC | |
Re: remove chars with regex
by Marshall (Canon) on Feb 26, 2025 at 09:29 UTC | |
by frank1 (Monk) on Feb 26, 2025 at 09:36 UTC | |
Re: remove chars with regex
by choroba (Cardinal) on Feb 26, 2025 at 09:41 UTC | |
Re: remove chars with regex
by johngg (Canon) on Feb 26, 2025 at 11:05 UTC | |
by Anonymous Monk on Feb 26, 2025 at 15:32 UTC | |
Re: remove chars with regex
by hippo (Archbishop) on Feb 27, 2025 at 08:14 UTC |