Extracting whole words
If you restrict yourself to ASCII letters, then use (with the re.I option set) \b[a-z]+\b \b is a word boundary anchor, matching only at the start and end of alphanumeric “words”. So \b[a-z]+\b matches pie, but not pie21 or 21pie. To also allow other non-ASCII letters, you can use something like this: \b[^\W\d_]+\b which also … Read more