The import re
HTML='" raw_title ":" the original OpenCV 3 artificial neural network recognition computer vision image retrieval concept of face detection and recognition computer vision tutorial spanning the programmer "'
TLT=re. The.findall (r '\ "raw_title " : \ ". *? \ ', HTML)
"Print (TLT)
Tlt1=re. The.findall (r "" raw_title \ ": ". * \ "', HTML)
Print (tlt1)
CodePudding user response:
Greed mode: A B B, match in the end A BNot greed mode: matching to the first B
The question is not zero or one
CodePudding user response:
You take a few more in your HTML can see the difference between the quotes,CodePudding user response:
The regex=r (?" <=: \ "). *? (?=\ s)"For this piece of string, can catch (the original OpenCV).
Wrong place please correct me,
CodePudding user response:
General. * is match any character, although a? A clear "break point", but then no identification character, it has been match until the end of the line,CodePudding user response:
Respond to you. *? The difference between and. *import re
HTML='" raw_title ":" the original OpenCV 3 artificial neural network recognition computer vision image retrieval concept of face detection and recognition computer vision tutorial spanning the programmer "'
TLT=re. The.findall (r '\ "raw_title " : \ ". *? Meter ', HTML)
Print (TLT)
Tlt1=re. The.findall (r '\ "raw_title " : \ ". *', HTML)
Print (tlt1)
"" "OUTPUTS:
[' "raw_title" : "the original OpenCV 3 meter ']
[' "raw_title" : "the original OpenCV 3 artificial neural network recognition computer vision image retrieval face detection and recognition meter ']" ""