Regex conversion on bbcode -


we moving phpbb simpler system , of bbcode needs converting, particularly "quote" code. current phpbb based quote code looks this:

[quote="username":nw4lek0o]the quoted text[/quote:nw4lek0o] 

and needs simplified this:

[quote=username]the quoted text[/quote] 

so, 2 things: strip double quotes around username, , strip id string opening , closing tag.

i'm not @ regex. help?

use regex:

\[quote="(.+?)":.+?\](.+?)\[/quote:.+?] 

and replace with:

[quote=$1]$2[/quote] 

demo: http://regex101.com/r/jl3xu2


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -