union in Python

Terry Reedy tjreedy at udel.edu
Wed Aug 13 11:42:37 EDT 2003


"Wiebke Pätzold" <wiebke.paetzold at mplusr.de> wrote in message
news:u6qjjv81q7vqq5mahauii8fllo67jqsegc at 4ax.com...
> I create a database that contains a table. 'Themenbereiche'  is one
of
> 13column names. This program can search for
> a special letter. In my example it is 'do'. and the search takes
place
> in 'Themenbereiche'. 'do' takes place within a word. This is solved
> with regular expression.

When looking for a particular string, rather than a pattern, you are
probably better off to use the find or index method of that string
rather than re.

>>> 'abcdefg'.find('d')
3

Terry J. Reedy






More information about the Python-list mailing list