in reply to [OT] How to take only the links of files which has high prirority links using perl?
Your code captures and assigns to $max_id only the last one of the first group of digits found. I expect that's probably not what you wanted.
perl -Mstrict -W -E 'say $1 if "hello 0 and 123 goodbye" =~ /(\d)+/;' 0
Perhaps you want:$ perl -Mstrict -W -E 'say $1 if "hello and 123 goodbye" =~ /(\d)+/;' 3
$ perl -Mstrict -W -E 'say $1 if "hello and 123 goodbye" =~ /(\d+)/;' 123
Hope this helps!
(Update: show suggested fix and additional failing example)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [OT] How to take only the links of files which has high prirority links using perl?
by finddata (Sexton) on Mar 16, 2017 at 11:51 UTC | |
by Anonymous Monk on Mar 16, 2017 at 12:28 UTC |