Searching for Strings
Searching for text in strings is a common activity and the built-in string function find() is all you need for simple searches. It returns the position (offset) of the find or –1 if not found.
>>> txt="The quick brown fox jumps over the lazy dog"
More Complex Searches
There are often circumstances when the search is not so simple. Rather than a simple string, we need to look for a pattern and extract the information we really want from the matched text. Suppose for example, we wanted to extract all the URLs in links on a web page. Here ...