After you've added some more specifications, let me recommend that you don't use a single regular expression. While it is still possible to create a regular expression that matchess your description, three if statements convey your rules much better.
In reply to Re^5: Regex pattern that fails when string contains a certain pattern
by Corion
in thread Regex pattern that fails when string contains a certain pattern
by hoppfrosch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |