Define "doesn't work." Aside from the fact that it matches a character after the closing bracket, it works fine for me.

Show your actual code, that's always a good place to start when debugging code.

If your code is more than 20 lines or requires significant setup (like a database or a form post), write out an example with hard-coded values. Like I said, the code works for me (except for your extraneous .)