Improvements to the list-detecting regex