In a few URLs I have on my website, they feed a parameter into the URL that sometimes contains [] in it. I have a preg_replace fixing some links, but the [] breaks my current system. How can i make this work? (I need it in the second half, for the name)

$ibforums->skin['_wrapper'] = preg_replace("'index.php\?portal=AOT&act=aom_rec_game&cmd=([a-zA-Z0-9]*)&name=([a-zA-Z0-9]*)'", "The-Titans/Replay/Command-\\1/Name-\\2.html", $ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?portal=AOT&act=aom_rec_game&cmd=([a-zA-Z0-9]*)&name=([\[\]a-zA-Z0-9]*)'", "The-Titans/Replay/Command-\\1/Name-\\2.html", $ibforums->skin['_wrapper']);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.