The short answer is, yes you can do things like that. If the part that you are matching contains regex characters like periods and parens, you will need to use quotemeta() to escape them.
In reply to Re: Can I Use Variables In A Regex?
by jZed
in thread Can I Use Variables In A Regex?
by Khatri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |