validate regex literals