Your solution will work if you replace the = by =~.
Hope this helps, -gjb-
In reply to Re: Regex with variables? by gjb in thread Regex with variables? by Quadzilla