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

前端 未结 5 654
面向向阳花
面向向阳花 2020-12-11 20:41

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:

         


        
5条回答
  •  佛祖请我去吃肉
    2020-12-11 20:55

    This accepted answer only captured the last character of the block for me. I ended up using this:

    $text =~ /(?s)bq\.(.+?)\n\n/g
    

提交回复
热议问题