strange behavior of parenthesis in python regex
问题 I'm writing a python regex that looks through a text document for quoted strings (quotes of airline pilots recorded from blackboxes). I started by trying to write a regex with the following rules: Return what is between quotes. if it opens with single, only return if it closes with single. if it opens with double, only return if it closes with double. For instance I don't want to match "hi there', or 'hi there", but "hi there" and 'hi there'. I use a testing page which contains things like: