What regex for replacing shortcodes in wordpress?

I am a regex newbie, but I do have a Regex plugin for wordpress: https://wordpress.org/plugins/search-regex/

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

Read More

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 ].

Related posts

Leave a Reply

1 comment