thirtySeven has asked for the wisdom of the Perl Monks concerning the following question:
I have tried to quite literally combine them but it did not work:# This works my $path = '/.snapshots123/yabsm/root/hourly/day=2021_03_04,time=21:20 +'; my $end_of_path = $1 if $path =~ m/([^\/]+$)/; my @nums = $end_of_path =~ m/([0-9]{2,4})/g;
I would appreciate insight.# This does not work my @nums = m/([0-9]+)/g =~ $1 if $path =~ m/([^\/]+$)/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I combine these two regular expressions?
by eyepopslikeamosquito (Archbishop) on Mar 05, 2021 at 03:49 UTC | |
by thirtySeven (Acolyte) on Mar 05, 2021 at 14:17 UTC | |
|
Re: How can I combine these two regular expressions?
by tybalt89 (Monsignor) on Mar 05, 2021 at 05:49 UTC | |
|
Re: How can I combine these two regular expressions?
by kcott (Archbishop) on Mar 05, 2021 at 06:09 UTC | |
|
Re: How can I combine these two regular expressions?
by Fletch (Bishop) on Mar 05, 2021 at 14:59 UTC | |
|
Re: How can I combine these two regular expressions?
by jcb (Parson) on Mar 05, 2021 at 03:41 UTC |