$var = "([f][o][o]|[b][a][r])"; @ret = grep(/$var/, @foo); [download]
In reply to set value of a variable to a regexp by pc2