After migrating some content from WordPress to Drupal, I\'ve got som shortcodes that I need to convert:
String content:
Irre
As described in this answer, I'd suggest letting WordPress do the work for you using the get_shortcode_regex()
function.
$pattern = get_shortcode_regex();
preg_match_all("/$pattern/",$wp_content,$matches);
This will give you an array that is easy to work with and shows the various shortcodes and affiliated attributes in your content. It isn't the most obvious array format, so print it and take a look so you know how to manipulate the data you need.