I have a method to extract all "words" from a string in javascript:
mystring.toLowerCase().match(/[a-z]+/g);
I would like to convert the same logic (create an array of "words" from my string), but in python. How can I achieve this?
Use findall() which is similar to String.prototype.match() .
findall()
String.prototype.match()
import re regex = r"[a-z]+" matches = re.findall(regex, strToScan)