improve regex pattern (by @homm)