2 Votes Vote

Regular expression to match a block of text up to the first double new line?

Posted by topdog 29 days ago Questions| regular expression regular expression All

I'm making a simple Textile parser and am trying to write a regular expression for "blockquote" but am having difficulty matching multiple new lines. Example:

bq. first line of quote
second line of quote
third line of quote

not part of the quote

It will be replaced with blockquote tags via preg_replace() so basically it needs to match everything between "bq." and the first double new line it comes across. The best I can manage is to get the first line of the quote. Thanks

Discuss Bury


Who Voted for this Question