Created
July 19, 2011 13:34
-
-
Save muhqu/1092344 to your computer and use it in GitHub Desktop.
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
function (doc) { | |
// DOESN'T WORK: | |
var version = /(\d+)\.?(\d+)?\.?(\d+)?/.exec("1.3"); | |
emit(version); | |
} |
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
[info] [<0.6354.4>] OS Process #Port<0.3446> Log :: function raised exception (new TypeError("/(\\d+)\\.?(\\d+)?\\.?(\\d+)?/.exec is not a function", "", 2)) with doc._id bf7b2575897460c9a5543a1f153089c8 |
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
function (doc) { | |
// WORKS: | |
var version = ("1.3").match(/(\d+)\.?(\d+)?\.?(\d+)?/); | |
emit(version); | |
var version = new RegExp(/(\d+)\.?(\d+)?\.?(\d+)?/).exec("1.3"); | |
emit(version); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment