OsvaldoM Posted January 13, 2011 Share Posted January 13, 2011 I'm a very basic user of regex and I bumped into a problem in which im a bit lost... I have a piece of text that comes with html tags and then through Solr it receives 2 custom tags to highlight words (<em> & <b>). My main problem is that i want to keep Solr's html tags but skip the rest and cleaning up the text before supplying it to Solr is not posible due to search configurations... So I want to keep something like "this is normal text <em><strong>myText</strong></em> and in here it continues" but skip all other html tags (including <strong> and <em> but that are not next to each other...) So this text: <strong>To be</strong> or <em><strong>not to</strong</em> <em>be</em> Should be stripped into this: To be or <em><strong>not to</strong</em> be Help would be highly appreciated!. Quote Link to comment https://forums.phpfreaks.com/topic/224323-regex-similar-to-strip_tags-but-with-added-functionality/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.