Let's say I have a string like:
$text = "<object>item_id1a2b3</object>xxx<object>item_id4c5d6</object>"
I want to convert it to: %ITEM:1a2b3xxx%ITEM:4c5d6
Here's what I've got:
$text = preg_replace("/<object.*item_id([a-zA-Z0-9]+).*<\/object/","%ITEM:$1",$text);
This isn't quite right, as the search is greedy.
Thoughts?
Thanks!