Leser: 1
10 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
use strict;
my @tests = (
"([0d-w9]ef+?)q"
);
my $string = $ARGV[0];
for my $line (@tests) {
if ($string =~ /$line/) {
print "Muster $line erkannt\n";
}
}
1
2
3
4
5
6
7
my @regexes = ('([\d\w]+)', 'another Regex');
my $regex = join('|',@regexes);
if($string =~ /($regex)/){
print $1;
}
1
2
3
4
5
6
7
8
9
10
my @list = (
qr/pattern1/,
qr/pattern2/,
qr/pattern3/,
qr{patter/patter not},
);
for my $line (@list ) {
if ( $string =~ $line ) { print "match\n"; }
}
Quote$ perl
# achte auf die geöffnete Klammer im 2. Pattern
my @regexes = ('([\d\w]+)', 'another (Regex');
my $regex = join('|',@regexes);
if($string =~ /($regex)/){
print $1;
}
^D
Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE ([\d\w]+)|another (Regex)/ at - line 6.
$
Quote[/quote]$ perl
# achte auf die geöffnete Klammer im 2. Pattern
my @regexes = ('([\d\w]+)', 'another (Regex');
my $regex = join('|',@regexes);
if($string =~ /($regex)/){
print $1;
}
^D
Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE ([\d\w]+)|another (Regex)/ at - line 6.
$
10 Einträge, 1 Seite |