Regex split into array of pieces

MegaGamer481

New Member
I was wondering how could I split this string \[code\]{{MENU}}<li><a href="http://stackoverflow.com/questions/3677223/{{LINK}}" title="{{TITLE}}"><span>{{TITLE}}</span></a></li>{{/MENU}}\[/code\]Into array of: \[code\]array( "<li><a href=http://stackoverflow.com/"", "{{LINK}}", "\" title=\"", "{{TITLE}}", "\"><span>", "{{TITLE}}", "</span></a></li>")\[/code\]It also should work with more different formats like:\[code\]{{MENU}}<a href="http://stackoverflow.com/questions/3677223/{{LINK}}" title="{{TITLE}}">{{TITLE}}</a>{{/MENU}}{{MENU}}<b><a href="http://stackoverflow.com/questions/3677223/{{LINK}}" title="{{TITLE}}">{{TITLE}}</a></b>{{/MENU}}\[/code\]My problem is that I don't know how to write this complex regex yet.
 
Back
Top