Skip to content

Instantly share code, notes, and snippets.

@neumino
Created September 18, 2014 21:31
// Suppose that there are 10 digits somewhere in the string
// Extract the 10 digits, and concatenate them
r.add(r.args(
r.expr('(123) 456-7890').match('^[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*([\\d]{1})[^\\d]*$')("groups")("str")
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment