Helper function that returns index of word in source or sub when not found