As Omer Kooheji said, the correct answer depends a lot on what the listbox contains.
However, on the basis of the Principle of least astonishment, I would recommend matching at the start of an entry; that’s the way it happens with most list boxes (in the Web, in time zone selection in Linux installations, etc. for example), so that is the behaviour that most users would expect.
However, that is a generic advice without knowing the exact application. If your application is such that people might not know the exact start but might know some substring in between, it obviously makes much more sense to match the input anywhere.
As a user, I appreciate a “contains” search rather than a “starts with”. Sometimes you can’t remember exactly what you’re looking for and it’s more helpful to suggest things that are similar to your search query rather than using it as a straight filter.
There are times when there are multiple way to list something as well, ie:
Shining, The - King, Stephen The Shining - Stephen King King, Stephen - The Shining
etc.. In my opinion, typing in “Shining” should return any of those results.
Surely the correct answer is it depends? What is your subject matter?
I’d vote for anywhere in the text or matching any whole word in the text (i.e. not having to match the middle of words) if you are feeling lazy.
Although there are some instances where and exact match from the first word is preferable.