AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

[PHP] PCRE's und Multiline

Ein Thema von CalganX · begonnen am 31. Mai 2004 · letzter Beitrag vom 31. Mai 2004
 
Benutzerbild von d3g
d3g

Registriert seit: 21. Jun 2002
602 Beiträge
 
#2

Re: [PHP] PCRE's und Multiline

  Alt 31. Mai 2004, 17:35
Zitat von Chakotay1308:
Funktioniert soweit ganz gut, aber obwohl ich den Modifier m gesetzt habe funktioniert es bei mehrzeiligen Texten nicht mehr.

Gibt es dafür eine plausible Erklärung?
Ja, der m-Modifier ist für was anderes gedacht.

Zitat von http://www.php.net/manual/en/pcre.pattern.modifiers.php:
When this modifier is set, the "start of line" and "end of line" constructs match immediately following or immediately before any newline in the subject string, respectively, as well as at the very start and end. This is equivalent to Perl's /m modifier. If there are no "\n" characters in a subject string, or no occurrences of ^ or $ in a pattern, setting this modifier has no effect.
Probiers mal mit
Code:
$match[] = '#\[quote\]((.|\n)*?)\[\/quote\]#i';
[EDIT]Mir fällt nur gerade auf: Willst du nicht ohnehin vorher noch alle \n durch
ersetzen? Dann ergibt sich das Problem nämlich gar nicht.[/EDIT]
-- Crucifixion?
-- Yes.
-- Good. Out of the door, line on the left, one cross each.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:43 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz