Regular Expressions 101

Community Patterns

Wordpress Shortcode Python

0

Regular Expression
Python

r"
\[(\[?)(?P<shortcodename>\w\S+)(?![/w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*(?:\[(?!\/\2\])[^\[]*)*)\[\/\2\])?)(\[?)
"
g

Description

Made up from wordpress shortcake php

Submitted by Nick Moreton - 2 years ago