added better regular expressions for Element to recognize python