How to use the question mark of regular expression in python
This article mainly introduces the python regular expression question mark how to use, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
1. Declaration and non-greedy matching.
2. Represents an optional grouping. Match zero or more times with asterisks, one or more times with plus signs, specific times with curly braces, greedy and non-greedy matches.
Example
Import re a = 'wxxIxxeuieiejfsdjxxlovexxfsiewiweirxxUxxwuerowiur'b = re.findall (' xx (. *?) xx', a) print (b) print (type (b)) for item in b:print (item)
Output
IloveU thanks you for reading this article carefully. I hope the article "how to use question marks in regular expressions in python" shared by the editor will be helpful to you. At the same time, I hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!