current version is shorter and use regex