Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
\[div(?:\sid=["|'](.*?)["|'])?(?:\sclass=["|'](.*?)["|'])?\](.*?)\[\/div\]
/
gms

Description

Converts the markdown shortcode for the dive element to the regular HTML:

Example shortcode: [div id="bla" class="ups"]some multiple line text[/div]

Submitted by Dux Linux - 3 years ago