In Python, I want to extract only the characters from a string.
Consider I have the following string,
input = \"{(\'players\',): 24, (\'year\',): 28
I think that you want all words, not characters.
result = re.findall(r"(?i)\b[a-z]+\b", subject)
Explanation:
"
\b # Assert position at a word boundary
[a-z] # Match a single character in the range between “a” and “z”
+ # Between one and unlimited times, as many times as possible, giving back as needed (greedy)
\b # Assert position at a word boundary
"