Skip to content

Instantly share code, notes, and snippets.

@ada-lovecraft
Last active December 16, 2015 20:09
Show Gist options
  • Save ada-lovecraft/5489966 to your computer and use it in GitHub Desktop.
Save ada-lovecraft/5489966 to your computer and use it in GitHub Desktop.
RegEx For Snwspeckle
// grabs the values from your html that represent the array for ansMap
((?<=ansMap\[\d] = ')|(?<=ansMap\[\d\d] = '))\w+
@ada-lovecraft
Copy link
Author

Breakdown:
(?<=ansMap[\d] = ') //find any line that starts with: ansMap[] = '
| // or
(?<=ansMap[\d\d] = ') //find any line that starts with: ansMap[] = '
(\d|\w)+ // and match the value that can be either a digit or a letter and get as many of them as possible until you run into something that isn't a digit or a letter.

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