Converting Ruby regexps to 'variants'.