Parsing elements using regular expressions