Thread Regex abkürzen? (9 answers)
Opened by bandchef at 2014-05-07 14:00

GwenDragon
 2014-05-07 14:29
#175401 #175401
User since
2005-01-17
14757 Artikel
Admin1
[Homepage]
user image
Code (perl): (dl )
1
2
3
4
5
my $re = qr{^.+?(SPort=)(\d+\s)(DIP=)(\d+.\d+.\d+.\d+\s)(DPort=)(\d+\s)(TP=)(\w+\s)(;)(\s)(\w+)}; # Regex erzeugen

if ( my @fields = ($line =~ $re) ) { # falls Regex in $re matcht, gecaptureted Felder (="Klammerausdrücke" des Regex) in @fields speichern
  # hier @fields weiter bearbeiten
}

View full thread Regex abkürzen?