What does ?s do in the following piece of code?
import re, pprint
text = open('books.xml').read()
pattern = '(?s)isbn=(.*?).*?title(.*?)/title'
found = re.findall(pattern, text)
mapping = {isbn: title for (isbn, title) in found}
pprint.pprint(mapping)
Here is books.xml
catalog
book
On Tue, 11 Nov 2014 01:37:21 -0800, satishmlmlml wrote:
What does ?s do in the following piece of code?
It tells you to learn about regex.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list