Skip to content

Instantly share code, notes, and snippets.

@NV
Created January 1, 2010 05:17
Show Gist options
  • Save NV/267050 to your computer and use it in GitHub Desktop.
Save NV/267050 to your computer and use it in GitHub Desktop.
Regex, why so greedy?
'wrath, greed, sloth, pride, lust, envy, and gluttony'.match(/greed.+/)
#<MatchData "greed, sloth, pride, lust, envy, and gluttony">
'wrath, greed, sloth, pride, lust, envy, and gluttony'.match(/greed.+?/)
#<MatchData "greed,">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment