Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
```(?<=```(?=[^`\n]))[^`\n]+
/
gm

Description

Combat md.replace(regex, "<pre>") and md.replace("```", "</pre>") to replace Markdown codeblocks with HTML ones

Submitted by Rix - 3 years ago