I am trying to find a suitable regex for processing WordPress shortcodes. Created an expression but it doesn't process all conditions.
Expression
\[feature([^\]]*)\]([^\]]*)\[\/feature\]
Example text
[feature title="Call us at" width="4" icon="fa-thumbs-up"]my phone is[/feature]
// shortcodes without linebrakes between
[feature title="Call us at" width="4" icon="fa-thumbs-up"]my phone is[/feature][feature title="Call us at" width="4" icon="fa-thumbs-up"]my phone is[/feature]
// with nested shortcode inside attributes
[feature title="Call us at [phone]" width="4" icon="fa-thumbs-up"]my phone is [other][/feature]
[feature title="Call us at [phone] sfdfasd" width="4" icon="fa-thumbs-up"]my phone is [other] dssafsd[/feature]
First two example works but for the nested shortcodes regex fails.
Here is the link for you to play with https://regex101.com/r/zA4iH4/7