I have a list of items stored in a variable as shown below:
listitems = ['<a href=\"\/other\/end\/f1\/738638\/adams\">Adams<\/a>\n', '<a href=\"\/other\/end\/f1\/23138\/donovan-smith\">Donovan Smith<\/a>\n']
I am trying to find the persons name, in my example the names are "Adams" and "Donovan Smith", however I need help accepting the special characters into the pattern, usually you would use a backslash but I am wondering if there is a way to accept multiple special characters at once without inserting multiple backslashes
I am also wanting to wildcard (ignore) the unique number and name in the weblink for example: 23138 and 'donovan-smith'
My current pattern looks as follows:
pattern1 = re.compile('<a href=\"\/other\/end\/f1\/23138\/donovan-smith\">(.*?)<\/a>\n')
Any help would be much appreciated.