Skip to content

Instantly share code, notes, and snippets.

@EkkoG
Last active October 12, 2016 15:53
Show Gist options
  • Save EkkoG/11a405bf47dee68a7bf124fb7ab5d71a to your computer and use it in GitHub Desktop.
Save EkkoG/11a405bf47dee68a7bf124fb7ab5d71a to your computer and use it in GitHub Desktop.
var str = '血红蛋白(123,g/L) 血红蛋白(1209803,g/L) 血红蛋白(19821,g/L)';
var regexp = /\((\d+)/g;
while (true) {
var r = regexp.exec(str);
if (r != null) {
console.log(r[1]);
}
else {
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment