Regex main compiling