Skip to content

Instantly share code, notes, and snippets.

@ramontayag
Created December 7, 2010 09:15
Show Gist options
  • Save ramontayag/731607 to your computer and use it in GitHub Desktop.
Save ramontayag/731607 to your computer and use it in GitHub Desktop.
How to 'send' this data?
Given this string {{images["220"]["x20"]["grayscale"]["something else"]}}
Using regex, how can I extract the following args?
1. 220
2. x20
3. grayscale
4. something else
But allow for unlimited args. For ex, given this regex {{images["220"]["x20"]["grayscale"]["something else"]["yet another thing"]}}
it'll get these args:
1. 220
2. x20
3. grayscale
4. something else
5. yet another thing
This is my sorry attempt: http://rubular.com/r/jYJjRSVX9K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment