vendredi 24 octobre 2014

split list having special characters words numbers and url


Vote count:

0




Guys I need small help:


I have a .txt file which has


"'the url address i checked is: https://www.google.com/ for 2times and it's awesome!."


expected output: ['"',"'",'the','url','address','i','checked','is',':','https://www.google.com/','for','2','times','and',"it's",'awesome','!','.','"']


how do i split this list to get the output using re.


I came up with this pattern: pattern = re.compile(r"\d+|[a-zA-Z]+[a-zA-Z']*|[^\w\s]") but this is also splitting my url. Can any one please help



asked 2 mins ago







split list having special characters words numbers and url

Aucun commentaire:

Enregistrer un commentaire