updated visualisation to use regular expressions