RegEx to find all text not in bbCode tags
Posted: Thu Feb 01, 2007 1:32 pm
Ok, I admit it, I am totally not strong in RegEx. I need some help and I cannot seem to figure this out at all.
Say I have a string like this (sorry for the code tag, but the PHP tag was making this little string puke three ways from sideways)...
I have all the jazz working for grabbing all the stuff in the [ php ] tags and doing what I want with that. What I want now is to be able to take all the text that is not in between [ php ] and [ /php ] tags and manipulate it. How in the world do I do that?
Say I have a string like this (sorry for the code tag, but the PHP tag was making this little string puke three ways from sideways)...
Code: Select all
<?php
$string = 'Here is some code
[php]<?php
// Run them through the function
if (!is_value_set($checks, $_POST))
{
// Error out
}
?>[/php]
I hope that helps
[php]<?php
$more = \'A little more code\';
?>[/php]';
?>