Check regexp validity, improved several patterns