Created
January 1, 2010 05:17
-
-
Save NV/267050 to your computer and use it in GitHub Desktop.
Regex, why so greedy?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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