Improvement/switch parser to regular expression