On Jul 18, 2:11 am, Eloff <dan.el...@gmail.com> wrote:
> Almost every time I've had to do parsing of text over the last 5 years
> I've needed this function:
[snip]
> It finds the first matching substring in the target string, if there
> is more than one match, it returns the position of the match that
> occurs at the lowest index in the string.

Alternatives:
(1) re.search(r"sub0|sub1|...", ...)
(2) google "Aho Corasick Python" (one result should be a thread in
this newsgroup within the last week)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to