[Tutor] Finding wich word matched in a OR re

Bernard Lebel 3dbernard at gmail.com
Thu Nov 10 19:36:12 CET 2005


Hello,

I have compiled this regular expression, with 3 strings. Basically it
looks like this.

r'word1|word2|word3'

The point is to try to match one of these words in a string.


Now let say I indeed got a match in a string. How can I find out wich
one, between word1-word2-word3 has the string been matched to?


Thanks
Bernard


More information about the Tutor mailing list