Fix regex compilation and set ucp flags