Say I'm making a simple BBCode function using regex, and I want the [color=] tag to stop parsing at the first semicolon to avoid exploits. Now I've seen this question all over stackoverflow, but it never shows how to implement it.
$regex = '/\[colour\=/[^;]*/](.*?)\[\/colour\]/is';
$replace = '<span style="color: $1">$2</span>';
Why is this giving me the error in the title? I can't figure out regex for the life of me, so I'm really stuck here.
If it helps any, here is the original regex I wanted to implement:
/[^;]*/