Skip to content

Instantly share code, notes, and snippets.

@cjus
Created November 27, 2012 00:31
Show Gist options
  • Select an option

  • Save cjus/4151625 to your computer and use it in GitHub Desktop.

Select an option

Save cjus/4151625 to your computer and use it in GitHub Desktop.
Parse text between curly braces
# src string: Add 2 Arcade Friends within 10 days
p = '{Add} {2} {Arcade Friends} {within} {10} {days}'
[i.split('{')[-1] for i in p.lower().replace(' ','_').split('}') if '{' in i]
@cjus
Copy link
Copy Markdown
Author

cjus commented Nov 27, 2012

Extract the text between curly braces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment