Thread Regex Frage (23 answers)
Opened by bianca at 2012-11-09 17:42

bianca
 2012-11-10 13:23
#163236 #163236
User since
2009-09-13
6977 Artikel
BenutzerIn

user image
2012-11-10T11:53:29 Raubtier
Ich bekomme mit dem obigen Code vor deinem Edit ohne den / das folgende Ergebnis:

Ich nicht. Bitte zeig mir mal deinen vollständigen Code. Es muss einen Unterschied geben.

Edit: Doch, eigentlich schon aber nicht wie erwartet.
$1 stimmt nicht. Es ist alles verschoben.
Hier das Ergebnis:
Code: (dl )
1
2
3
Use of uninitialized value $7 in concatenation (.) or string at test.pl line 29.
Zeile 0: matcht 1='[Thu Nov 08 22:59:19 2012] [error] Hostname www.......de provided via SNI, but no hostname provided in HTTP request' 2='Nov' 3='08' 4='22:59:19' 5='2012' 6='error' 7=''
Zeile 1: matcht 1='[Fri Nov 09 09:49:30 2012] [error] [client 8.1.1.1] Can't modify constant item in scalar assignment at /script.pl line 16, near "'schiess mich tot';", referer: https://.......pl' 2='Nov' 3='09' 4='09:49:30' 5='2012' 6='error' 7='8.1.1.1'


Haben möchte ich aber das hier:
Code: (dl )
1
2
3
4
Use of uninitialized value $6 in concatenation (.) or string at test.pl line 42.
Zeile 0: matcht 1='Nov' 2='08' 3='22:59:19' 4='2012' 5='error' 6='' 7='Hostname www.......de provided via SNI, but no hostname provided in HTTP request'
Zeile 1: matcht 1='Nov' 2='09' 3='09:49:30' 4='2012' 5='error' 6='8.1.1.1' 7='Can't modify constant item in scalar assignment at /script.pl line 16, near "'schiess mich tot';", ref
erer: https://.......pl'

Das untere kommt, wenn ich den selben Regex nicht in einer Variable verwende.
Was läuft da falsch?

Editiert von bianca: Edit ergänzt

modedit Editiert von GwenDragon: Bitte Ausgaben in CODE-Tags sonst werden sinnlos automatische URL erstellt
Last edited: 2012-11-12 12:13:51 +0100 (CET)
10 print "Hallo"
20 goto 10

View full thread Regex Frage