RegEx: find all occurances of a single character in a string

Franz Steinhaeusler franz.steinhaeusler at utanet.at
Wed Dec 15 03:38:55 EST 2004


On Tue, 14 Dec 2004 14:05:38 +0100, Franz Steinhaeusler
<franz.steinhaeusler at utanet.at> wrote:

>given a string:
>
>st="abcdatraataza"
>    ^   ^     ^ ^ (these should be found)
>I want to get the positions of all single 'a' characters.
>(Without another 'a' neighbour)
>[...]

Thank you again, Pádraig and Steve,
your solution looks still more compact.

There are several regular expression, that this could 
almost justify an own newsgroup.

Or is there another group, where these questions are more
appropriate?

-- 
Franz Steinhaeusler



More information about the Python-list mailing list