Simple interpolation will work in the simple case, but if you want regex characters in the string to match literally, you will need either quotemeta or to use the index builtin instead of pattern matching.
In reply to Re: Can a regular expression include an arbitrary string variable?
by jcb
in thread Can a regular expression include an arbitrary string variable?
by anautismobserver
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |