Search
Other DB Replacer questions
Forum

Regex to Remove WordCrap :-)

Elisa Foltyn's Avatar Elisa Foltyn
Hi! I have a working and tested regex (in regexer) to remove Word-Stuff inside articles but dbreplacer pro can't find it?

<!-- \[if gte mso 9\]>.*?<!\[endif\]-->/smg

Testing String:
<!-- [if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>/n
</o:OfficeDocumentSettings>
</xml><![endif]-->

What am i doing wrong?

thank you,
Elisa
Peter van Westen's Avatar Peter van Westen ADMIN
Try:
<\!-- \[if gte mso 9\]>.*?<\!\[endif\]-->
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
Thanks, but that does not find anything either. :-/
But I tested it successfully against the existing text in regexer.
Peter van Westen's Avatar Peter van Westen ADMIN
Can you give me (super) admin access so I can take a look?
You can use the 'Confidential information' button in the forum editor to hide sensitive information.
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
Ok here it is, thank you:

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
For some reason it is not handling the new lines properly. This could be down to php version and regex settings on the server.

Anyway, you should be able to do what you want with:
<\!-- \[if gte mso 9\]>([^!]*\n)*.*?<\!\[endif\]-->
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
Thank you! That looks great - doing a backup and executing 🙂 Fingers crossed!
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription