Regular Expressions 101

Community Patterns

Break PANEL webcomic

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(PANEL\s+\S+)(.*?)(?=PANEL|\Z)
/
gms

Description

regex that wrap the Panel section with <div class="panel">$&</div> so it will display like a webcomic

codepen link: https://codepen.io/mangadrawing123/pen/oNwavgQ?editors=0110

Submitted by anonymous - 3 years ago