in reply to remove first and last character of string
use strict; use warnings; use Test::More tests => 1; my $string = q/"654321_1111"/; my $regex = qr/^\"(.+)\"$/; my $expected = q/654321_1111/; (my $got) = $string =~ m/$regex/; is( $got, $expected, q/Remove quotes/ );
Output:
1..1 ok 1 - Remove quotes
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: remove first and last character of string
by AnomalousMonk (Archbishop) on Oct 14, 2020 at 07:11 UTC | |
Re^2: remove first and last character of string
by flieckster (Scribe) on Oct 14, 2020 at 02:43 UTC | |
by AnomalousMonk (Archbishop) on Oct 14, 2020 at 03:27 UTC | |
by hippo (Archbishop) on Oct 14, 2020 at 09:09 UTC | |
by flieckster (Scribe) on Oct 15, 2020 at 00:47 UTC | |
by hippo (Archbishop) on Oct 15, 2020 at 08:35 UTC | |
by BillKSmith (Monsignor) on Oct 14, 2020 at 19:16 UTC |