add unicode flag support to regex