What regex for replacing shortcodes in wordpress?

admin

Administrator
Staff member
I am a regex newbie, but I do have a Regex plugin for wordpress: <a href="https://wordpress.org/plugins/search-regex/" rel="nofollow">https://wordpress.org/plugins/search-regex/</a>

Here's what I need to search for:
[flickr set=72157627233903733 photo=6]

and here's what I need to replace it with:
[flickr_set id="72157627233903733"]

there are a couple of the shortcodes that look like this:
[flickr set=72157627532956200 photo=14190577477 size=small align=right hspace=10 vspace=10]

and they need the same replacement:
[flickr_set id="72157627532956200"]

What's a simple regex to do this? I basically need to search for [flickr set= and ignore everything after the set id until the closing bracket ].