Regx is not my thing.
I have a large file where I want to replace the following example:
<g:id><![CDATA[131614-3XL]]></g:id>
should be replace with:
<g:id><![CDATA[131614-3XL]]></g:id><g:id2><![CDATA[131614]]></g:id2>
Please note that "-3XL" is deleted in id2 and please note that -3XL could be many other combinations. fx. -4XL or -32/32 or -42,5 and so on. But it always starts with -
I have tried using preg_replace but I can figure it out.
preg_replaceattempts.please note that -3XL could be many other combinationsDOMDocument.