Schrift
Wiki:Tipp zum Debugging: use Data::Dumper; local $Data::Dumper::Useqq = 1; print Dumper \@var;
[thread]8920[/thread]

extended regexp crashed: Freitag der 13. ist doch erst morgen?



<< >> 3 Einträge, 1 Seite
dukeofnukem
 2007-04-12 19:39
#75971 #75971
User since
2007-01-15
47 Artikel
BenutzerIn
[default_avatar]
ohne Worte...

Code: (dl )
1
2
perl -ne 'print if s#(?</dev)/md0#lalala#x' </etc/mtab
Sequence (?</...) not recognized in regex; marked by <-- HERE in m/(?</ <-- HERE dev)/md0/ at -e line 1.


Code: (dl )
1
2
perl -v
This is perl, v5.8.3 built for x86_64-linux-thread-multi


Aber mal ehrlich: Was mache ich hier falsch?
Die Doku sieht so aus als ob ich es richtig machen würde...

Thx!
drum&bass is a state of mind
renee
 2007-04-12 21:21
#75972 #75972
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Du hast in der falschen Doku geschaut. Die Doku für RegEx ist perlre.

Es gibt kein Konstrukt (?</), sondern nur

Quote
# (?<=pattern)

A zero-width positive look-behind assertion. For example, /(?<=\t)\w+/ matches a word that follows a tab, without including the tab in $& . Works only for fixed-width look-behind.
# (?<!pattern)

A zero-width negative look-behind assertion. For example /(?<!bar)foo/ matches any occurrence of "foo" that does not follow "bar". Works only for fixed-width look-behind.
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
dukeofnukem
 2007-04-13 12:37
#75973 #75973
User since
2007-01-15
47 Artikel
BenutzerIn
[default_avatar]
*ARGH*

Aus O'Reilly, Perl in a Nutshell, 2nd Edition:

Quote
(?<...)
A zero-width positive lookbehind assertion. For example, /(?<bad)boy/ matches the word boy that follows bad, without including bad in $&. This works only for fixed-width lookbehind.


Hätte ich mir aber auch denken können daß das ein Druckfehler ist, die Analogie zu (?=...) ist irgendwie schon gegeben...

Mist.

Aber vielen Dank!
drum&bass is a state of mind
<< >> 3 Einträge, 1 Seite



View all threads created 2007-04-12 19:39.