#Try to find entity names in raw, possibly badly formed HTML,# but avoid things where the & seems to be part of a URL query string'&([\#A-Za-z0-9]+)(?=[;\s\.\,])', '&amp; &bad. &#234 link?a=1&b=2&coo=3')# gives:['amp', 'bad', '#234']