Oops, this one should be a regex
little demo, fixed some bugs/corner cases