in reply to How can I combine these two regular expressions?
#!/usr/bin/perl use strict; use warnings; my $path = '/.snapshots123/yabsm/root/hourly/day=2021_03_04,time=21:20 +'; my @nums = $path =~ m/([0-9]{2,4})(?!.*\/)/g; print "@nums\n";
Outputs:
2021 03 04 21 20
|
|---|