using regular expressions instead of splits
changing test to us a regular expression