Thread Mehrere reguläre Ausdrücke finden (12 answers)
Opened by Stephan at 2005-02-28 17:22

Crian
 2005-02-28 18:44
#52174 #52174
User since
2003-08-04
5870 Artikel
ModeratorIn
[Homepage]
user image
ja stimmt, dann so

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

local $_ = <<ENDE;
<OrderPosAd Datum="2005-02-28" Bla="blubb">hjgadf</OrderPosAd>
<Suppe>Grünkern</Suppe>
<OrderPosAd Datum="2005-02-27" Bla="blubber">hjishfgadf</OrderPosAd>
<Fleisch>Putenbrust</Fleisch>
<OrderPosAd Datum="2005-02-26" Bla="blasenwerf">hjoejwhishfgadf</OrderPosAd>
ENDE

my @gefunden;

while (s~<OrderPosAd([^<>]*)>[^<>]+</OrderPosAd>~~) {
my $tag = $1;
my ($merkmal) = $tag =~ / Datum=\"(.*?)\"/;
push @gefunden, $merkmal;
}

print "@gefunden";


Ausgabe

Code: (dl )
2005-02-28 2005-02-27 2005-02-26
s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;

use strict; use warnings; Link zu meiner Perlseite

View full thread Mehrere reguläre Ausdrücke finden