python - Regex match even number of letters -
i need match expression in python regular expressions matches number of letter occurrences. example:
aaa # no match aa # match fsfaaaasdf # match safa # match sdaaewasa # match aeaia # no match
an number of should match.
try regular expression:
^[^a]*((aa)+[^a]*)*$   and if as don’t need consecutive:
^[^a]*(a[^a]*a[^a]*)*$      
Comments
Post a Comment