Regular Expressions: get what is outside of the brackets

cassyEdwards

New Member
I'm using PHP and I have text like:\[code\]first [abc] middle [xyz] last\[/code\]I need to get what's inside and outside of the brackets. Searching in StackOverflow I found a pattern to get what's inside:\[code\]preg_match_all('/\[.*?\]/', $m, $s)\[/code\]Now I'd like to know the pattern to get what's outside.Regards!
 
Back
Top