Be smarter about warnings

Only display the warning about periods in strings if there are actually
periods in strings.
Try to make regular expressions a bit faster

pre-compile things.

It probably doesn't matter too much, because python cycles are assumed
to be cheap in comparison with coq cycles.