Python Forum
Python Regulare Expression
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Regulare Expression
#1
I have this code here and I want to know how to interpret it:
found = re.findall(
        r'encoding="UTF-8"\?>(.*?)^<\?xml version="1.0"', clean, re.M | re.S,
    )
I can see where "Clean" comes from, but not sure what is "re.M" and "re.S". Can I please get an explanation of the whole syntax.
Reply
#2
The docs:
https://docs.python.org/3/library/re.html#re.M
https://docs.python.org/3/library/re.html#re.S
Gribouillis likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020