Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^([^()[\]{}<>]*)(\(((?1)(?2)*)*\)|\[(?3)*\]|<(?3)*>|{(?3)*})(?1)$
/

Description

Check the correct order of the brackets (),<>,{},[] fix slashes

Submitted by Korniychuk Anton<ancor.dev@gmail.com> - 8 years ago