Thread Wildcards mit Perl (7 answers)
Opened by cooldie at 2005-07-20 16:11

renee
 2005-07-20 16:53
#5297 #5297
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Wildcard.txt:
Code: (dl )
T*s*

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use strict;
use warnings;

my @re;

open(my $fh,"<$ARGV[0]") or die $!;
while(<$fh>){
chomp;
s/\*/.*/g;
push(@re,$_);
}
close $fh;

for(@re){
print "yes" if('Test' =~ /^$_$/);
}


Edit: Aufruf: skript.pl wildcard.txt\n\n

<!--EDIT|renee|1121864020-->
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Wildcards mit Perl