Thread Regex abkürzen?
(9 answers)
Opened by bandchef at 2014-05-07 14:00 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 } |