Anyone got the regex to allow any character but "]" ehh //quote '/\[quote\=([a-zA-Z0-9-_!\.$\+%^ ?]+)](.*?)\[\/quote\]/is' => "<blockquote><div><cite><i>Posted By:</i> \\1</cite>\\2</div></blockquote>", PHP: I'm sick of adding things to the regex when people change their usernames with different characters on my forums so yeah Idk if this makes sense, so sorry if I'm blabbering on buttttttt I want [ quote=5454fd$%(£"$!%*!%*!"%)¬_*"%% ]dsfgsdf[ /quote ] to work but not [ quote=fdsf]] fsf [ /quote ]
'/\[quote\=([^]]+)\](.*?)\[\/quote\]/is' => "<blockquote><div><cite><i>Posted By:</i> \\1</cite>\\2</div></blockquote>", PHP: When using ^ in the square brackets [ ], it means NOT, unlike when using it outside of them means the beginning of the string. So basically, the code to put in your first ( ) is [^]]+ This will basically mean as long as the next char isn't ], continue, and when it finally does hit one, it will obviously break out of the ( ) and assume the ] is for the closing of the opening quote tag. Also, you forgot to escape the closing ] in your first quote tag, which I did in my example. Oddly enough, you do not escape the ] inside the []. At least I didn't have to, and when I did, it did not work properly. EDIT: Actually, nevermind, you shouldn't have to escape that closing ] that I said you missed. Doesn't seem to matter. Just gotta escape the opening ones, most likely. Let me know how it works!