Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
<[pP]-([a-zA-Z-]+)([^>]*)?>[\s\n]*<\/[pP]-\1>
/
mg

Description

This regular expresion matches opening and closing empty tags from PrimeNG library. This can be useful to replace it for self-closed tags which is available from Angular v15. Replacer: <p-$1$2/>

Submitted by https://sergiorey23.github.io/ - 18 days ago (Last modified 17 days ago)