Skip to content

Instantly share code, notes, and snippets.

@craigsdennis
Last active August 29, 2015 14:21
Show Gist options
  • Save craigsdennis/bb225b54dce29f6c8a36 to your computer and use it in GitHub Desktop.
Save craigsdennis/bb225b54dce29f6c8a36 to your computer and use it in GitHub Desktop.
Regular Expression Example in Python
import re
title = "Regular Expressions in 10 different languages"
result = re.match(r'.*\d+.*', title)
match = re.search(r'(\d+)', title)
# This will return None match is not found
if (match):
print('There are {} languages represented.'.format(match.group(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment