using regex matching on scala