Regular Expressions 101

Community Patterns

Definition List in PHP Markdown Extra

0

Regular Expression
ECMAScript (JavaScript)

/
*(?:.*\S.*\n)+\n? *: +(?:.|\n)+?(?:\n{2,}(?=\S)(?! *: +)(?! *(?:\S.*\n)+?\n? *: +)|$)
/
g

Description

This is the ECMAScript version of PHP regex for matching definition list as defined in PHP Markdown Extra.

Submitted by Chattille - 2 years ago