pulled regex finding out into its own method for reasons