improved regexp validator, related to #123