Quick self-note đ
different ways to search for content in a string in python
- Basic (and quickest)
if 'content' in string:
- String.find (second quickest and doesnât need additional module)
if string.find('content'):
- re.match (uses regex engine, most powerful)
import reif re.search('content', string)
Good discussion here : https://stackoverflow.com/questions/4901523/whats-a-faster-operation-re-match-search-or-str-find
HOWTO : Python string search
Quick self-note đ different ways to search for content in a string in python Basic (and quickest) if âcontentâ in string: String.find (second quickest and doesnât...