Thread RegEx: optionale Matches an Subroutine weitergeben (31 answers)
Opened by Froschpopo at 2007-09-25 23:57

Froschpopo
 2007-09-26 23:24
#100043 #100043
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl

use strict;

my $string = 'Das ist Martin: [BILD=martin.gif NAME="asd ass as" NAME2=hallo]';

$string = ~s!\[(.+?)\]!parse(map{split(/\s+(?=\w+$)/,$_)}split(/\s*=\s*/,$1))!gse;

sub parse {
my %params = @_;
unless (-e $params{BILD}) {
return "File not found\n";
}
}

print $string;


Ergibt:
4294967295

???

View full thread RegEx: optionale Matches an Subroutine weitergeben