Last active
February 26, 2020 12:12
-
-
Save rafaelnp/a94db240c156467e1cd139b01f5a2695 to your computer and use it in GitHub Desktop.
List of useful python regular expressions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python RegEx list | |
# Rafael do Nascimento Pereira <rnp@25ghz.net> | |
# | |
# | |
# References | |
# | |
# 1 - Pytho RegEx (with examples) | |
# https://www.programiz.com/python-programming/regex | |
# | |
# 2 - online regex tester and debugger | |
# https://regex101.com/ | |
# | |
import re | |
# match string before the hyphen '-' | |
# returns string: "WhatIWant" | |
re.search(".*(?=-)". "WhatIWant-WhatIDontWant") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment