DeveloperBreeze

Split Development Tutorials, Guides & Insights

Unlock 2+ expert-curated split tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your split skills on DeveloperBreeze.

Python Regular Expressions (Regex) Cheatsheet

Cheatsheet August 03, 2024
python

match = re.search(r'\d+', 'The price is 100 dollars')
if match:
    print(match.group())  # Output: 100

match = re.match(r'\d+', '123 apples')
if match:
    print(match.group())  # Output: 123

match = re.fullmatch(r'\d+', '12345')
if match:
    print(match.group())  # Output: 12345
matches = re.findall(r'\d+', 'There are 12 apples and 5 oranges')
print(matches)  # Output: ['12', '5']

matches = re.finditer(r'\d+', 'There are 12 apples and 5 oranges')
for match in matches:
    print(match.group())  # Output: 12 5

Reversing a String in JavaScript: A Simple Guide

Code January 26, 2024
javascript python

Try experimenting with this function using different strings, and see how you can adapt it for other use cases!