You could also use the (?(...)TRUE|FALSE) assertion to clean that up a bit:/(?:(?=\w)(?<!\w)|(?=\W)(?<!\W))($thing)(?:(?<=\w)(?!\w)|(?<=\W)(?!\W) +)/
/(?(?=\w)(?<!\w)|(?<!\W))($thing)(?(?<=\w)(?!\w)|(?!\W))/
In reply to Re: Regex help
by japhy
in thread Regex help
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |