Reputation: 9087
I want to grab the start of the first alphabetical characters at the beginning of the string:
||hello there -> hello there
((hello there -> hello there
I am using this code:
str = re.findall('^[^a-zA-Z]+(.*?)', str)
str gives me an array of two strings, the first string which is a blank string.
Upvotes: 1
Views: 182
Reputation: 91428
To be unicode compatible, use \pL
wich means a letter.
^\pL
This regex ensure you that you have at least one letter at the begining of the string.
If you want to capture the rest of the string:
^\pL(.*)$
Upvotes: 0