maestrog Posted January 20, 2012 Share Posted January 20, 2012 $string ="yada yada yada<pre>This is what I wants to see!</pre>"; preg_match('/<pre.*?>(.*?[<pre.*?>.*<\/pre>]*)<\/pre>/', $string, $matches); echo $matches[1]; This outputs....This is what I wants to see! If I put these pre tags in mysql or any tags....$matches come up empty. Please help. I am running php 5.3.1 and it has stream filters I cannot turn off including "stream_tags.strip". I have a remote host running php5.0.4 which does not do this. I must get on with my regex work. Thanx for any help. Quote Link to comment https://forums.phpfreaks.com/topic/255398-php-is-stripping-tags-from-database/ Share on other sites More sharing options...
joe92 Posted January 22, 2012 Share Posted January 22, 2012 Please use the code tag on code $string ="yada yada yada<pre>This is what I wants to see!</pre>"; preg_match('/<pre.*?>(.*?[<pre.*?>.*<\/pre>]*)<\/pre>/', $string, $matches); echo $matches[1]; If I put these pre tags in mysql or any tags....$matches come up empty If you place this into mysql you will most likely be using common basic security such as htmlentities or htmlspecialchars on the input both of which converts the < and > into their respective html codes, < and >. After saying this I've come to realise I don't really know what your problem is... Could you please ask the question again in a way that we could understand? What's the regex being used for? Cheers, Joe Quote Link to comment https://forums.phpfreaks.com/topic/255398-php-is-stripping-tags-from-database/#findComment-1310062 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.