Your code looks correct, although as the other reply suggests if you wish to have an ampersand displayed in a browser you should probably use the '&' entity.
Have you verified that your form input contains what you think it does? For example no trailing whitespace, etc?
In reply to Re: Regular Expression Problem
by skx
in thread Regular Expression Problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |