Skip to content

Instantly share code, notes, and snippets.

@nybblr
Created January 22, 2018 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nybblr/f480018a181bf60a66183e1ab3ce23e0 to your computer and use it in GitHub Desktop.
Save nybblr/f480018a181bf60a66183e1ab3ce23e0 to your computer and use it in GitHub Desktop.
Google sheets functions for meetup
function getCost(cell) {
return cell.match(/\$[\d.,]+\d/)[0]
}
function getCondition(cell) {
return cell.match(/((like )?new|used|mint|good|great|excellent)/i)[0]
}
function getEmail(cell) {
return (cell.match(/[^\s@]+@[^\s@]+/i) || ['N/A'])[0]
}
var phoneRegex = /\(?([0-9]{3})\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})/
function getPhone(cell) {
return (cell.match(phoneRegex) || ['N/A'])[0]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment