<jupyter_start><jupyter_text>Identifiers: \ used to escape a character \d any number \D anything but a number \s space \S anything but a space \w any character \W anything but a character . any character except a new line \. actually a period \b whitespace around words  Modifiers: {1,3} we're expecting 1-3 + Match 1 or more ? Match 0 or 1 * Match 0 or more (dollar_sign) match the end of a string ^ match the beginning of a string | matches either or e.g. \d{1-3}|\w{5-6} [] Match range or "variance" e.g. [A-Za-z] or [1-5a-qA-Z] {x} expecting "x" amount  White Space Characters: \n new line \s space \t tab \e escape (rare) \f form feed (rare) \r return DON'T FORGET!: To use them, you need to escape them . + * ? [ ] dollar_sign ^ ( ) { } \ |<jupyter_code>#Pull out names and ages from example string.

import re

example = '''
Jessica is 15 year old, and Danial is 25 year old.
Edward is 97, and his grand father, Oscar, is 102.
'''

# r for regular expression
ages = re.findall(r'\d{1,3}', example)
names = re.findall(r'[A-Z][a-z]*', example)

dict = {}
x = 0
for name in names:
    dict[name] = ages[x]
    x+=1
    
print(dict)<jupyter_output>{'Jessica': '15', 'Danial': '25', 'Edward': '97', 'Oscar': '102'}
{'fraction_non_alphanumeric': 0.140625, 'fraction_numerical': 0.029605263157894735, 'mean_word_length': 3.5074074074074075, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '328704', 'license': 'MIT', 'n_tokens_mistral': 456, 'n_tokens_neox': 425, 'n_words': 179, 'path': '11. Regular Expressions.ipynb', 'repo_name': 'HussamCheema/Python', 'size': '1216'}