mid: lib: fix invalid regexp in duplicate variable searching