Improve regex flags