auto-detect regexps