Leser: 1
5 Einträge, 1 Seite |
1
2
3
4
5
my $line = 'abc123def456ghi';
if (my @matches = $line =~ m/\w+?(\d+)/g) {
print "@matches\n";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use strict;
use warnings;
my @strings = (
'<a href="http://.../1.zip">1</a><a href="http://.../2.zip">2</a>',
'<a href="http://.../3.zip">3</a><a href="http://.../4.zip">4</a>',
'<a href="http://.../5.zip">5</a><a href="http://.../6.zip">6</a>',
'<a href="http://.../7.zip">7</a><a href="http://.../8.zip">8</a>',
'<a href="http://.../9.zip">9</a><a href="http://.../10.zip">10</a>',
);
foreach my $line (@strings) {
foreach my $zip ( $line =~ m|href="(http.+?\.zip)"|g ) {
print $zip, "\n";
}
}
1
2
3
4
5
6
7
8
9
10
http://.../1.zip
http://.../2.zip
http://.../3.zip
http://.../4.zip
http://.../5.zip
http://.../6.zip
http://.../7.zip
http://.../8.zip
http://.../9.zip
http://.../10.zip
1
2
my $octet = q/(?: 25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})/;
my $ipaddr = qr/^$octet\.$octet\.$octet\.$octet\z/x;
5 Einträge, 1 Seite |