G'day SergioQ,
You capture multiple matches with a regex by using the 'g' modifier.
Example code:
#!/usr/bin/env perl use strict; use warnings; my $string = '... data-src-hq="qwe" ... ' . '... data-src-hq="asd" ... ' . '... data-src-hq="zxc" ...'; my @matches = $string =~ /data-src-hq="([^"]+)"/g; print "@matches\n";
Output:
qwe asd zxc
— Ken
In reply to Re: Need help using regex to extract multiple matches
by kcott
in thread Need help using regex to extract multiple matches
by SergioQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |