Regexp fixes

Quotes around regexp functions, and matchdata instead of globals!