Skip to content

ybgirgin3/Regexes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Regexes

Easy regex finder for Python

## installation

~$ pip install Regexes

Usage:

  • For extracting all possible info from string
from Regexes import Regexes


string = """
Hello My name is Berkay and this is my project
[email protected], [email protected],
05323450002,
05430000778,
[email protected]
"""

ret = Regexes(data=string).find_reg()
print(ret)


# ---------------------------
# {'btc_addresses': [],
#  'credit_cards': [],
#  'dates': [],
#  'emails': ['[email protected]',
#             '[email protected]',
#             '[email protected]'],
#  'hex_colors': [],
#  'ips': [],
#  'ipv6s': [],
#  'links': ['gmail.com', 'doner.com', 'bekocanholding.com'],
#  'phones': ['05323450002', '05430000778'],
#  'phones_with_exts': [],
#  'po_boxes': [],
#  'prices': [],
#  'ssn_number': [],
#  'street_addresses': [],
#  'times': [],
#  'zip_codes': []}
  • For specific type of info
from Regexes import Regexes


string = """
Hello My name is Berkay and this is my project
[email protected], [email protected],
05323450002,
05430000778,
[email protected]
"""

ret = Regexes(data=string, dtype="emails").find_reg() # * Just add dtype arg
print(ret)


# ---------------------------
# {'emails': ['[email protected]',
#             '[email protected]',
#             '[email protected]']}

Credit: CommonRegex