Fix regex building