2006/5/4, Martin Alterisio <[EMAIL PROTECTED]>:


2006/5/3, Nathan Heaps <[EMAIL PROTECTED]>:

> Ok, scratch that, new problem. what can I replace (.*?) with in order
> for
> php to recognise a multi-line quote/bold/italic/code/whatever?


By default the "." pattern matches anything except a line break you can
either use ((?:.|\n)*) or add a modifier to the regular expression that
changes the behaviour of the "." pattern. Modifiers are appended at the end
of the regular expression, after the closing delimiter:

/\[i:(.*?)\](.*?)\[\/i:(.*?)\]/s


The "s" modifier tells the regular expression to captura any character
with an "." pattern. With only this you should be able to captura multiline
tags.

Also you should consider using the "U" modifier which makes all repetition
patters (*,+) ungreedy. This way you can avoid using the "?" after



Sorry, las message wasn't send properly (gmail isn't working right anymore
for me). The last part was cutoff, it said:

Also you should consider using the "U" modifier which makes all repetition
patters (*,+) ungreedy. This way you can avoid using the "?" after all
repeated patterns:

/\[i:(.*)\](.*)\[\/i:(.*)\]/sU

Reply via email to