All Questions
2 questions
2
votes
1
answer
4k
views
Efficient multiple substrings search
I have many substrings(2-5 words each) which I would like to search in some text of about 40-50 words length. What is the most efficient way to flag matching substrings.
Currently I am simply using:
...
0
votes
1
answer
2k
views
Most Pythonic way to remove first match of potential leading strings?
This is a bit difficult to describe, but I'll do my best.
In Python, I can use string.startswith(tuple) to test for multiple matches. But startswith only returns a boolean answer, whether or not it ...