in reply to Regex Question

I think you ask for ? to make it non greedy and s to make . include newlines.
/U(\d+\.\d+)\n{2}(.+?)\n{2}/s;
update:tachyon point me to a typeo in the regex the ? was after the )
Boris

Replies are listed 'Best First'.
Re: Re: Regex Question
by tachyon (Chancellor) on Apr 11, 2004 at 12:37 UTC

    The ? needs to be inside the capturing parenths like  (.+?). In your example  (.+)? you have code that effectively reads the least ammount of greedy matches and as a result fails to DWIM.