Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ref>*Any_Character_Could_Be_Here</ref>
- >>> import re
- >>> test_string = '''<ref>*Any_Character_Could_Be_Here</ref>
- <ref>other characters could be here</ref>'''
- >>> re.findall(r'<ref>.*?</ref>', test_string)
- ['<ref>*Any_Character_Could_Be_Here</ref>', '<ref>other characters could be here</ref>'] # a list of matching strings
- if re.search(r"<ref>*[^<]*</ref>", subject):
- # Successful match
- else:
- # Match attempt failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement