I have a method for extracting all the "words" from a string in javascript:
mystring.toLowerCase().match(/[a-z]+/g);
I'd like to convert that same logic (create an array of "words" from my string), but in python. How can I achieve that?
Use findall()
, which is similar to String.prototype.match()
.
import re
regex = r"[a-z]+"
matches = re.findall(regex, strToScan)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments