3

does anyone know which string matching algorithm is implemented in Python?

2
  • What do you mean by string matching algorithm? Give an example of use please. Commented Jan 17, 2010 at 1:48
  • The answer is: “Both.” (“…country AND western…”) Commented Jan 18, 2010 at 22:56

2 Answers 2

9

Per the sources, it's a

fast search/count implementation, based on a mix between boyer-moore and horspool, with a few more bells and whistles on the top. for some more background, see: http://effbot.org/zone/stringlib.htm

The essay in question is really well worth reading!

Sign up to request clarification or add additional context in comments.

Comments

1

I assume you're talking about CPython. In that case, you could always check the source (see fastsearch.h).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.