Skip to content

Instantly share code, notes, and snippets.

@pgburt pgburt/index.js Secret
Created Jan 8, 2016

What would you like to do?
Regex is a cruel companion.
#!/usr/bin/env node
var validate = require('data-validate');
var protocol = "(https?|ftp)\:\/\/"
var uri = "[^\s/?\.#-]+"
var pattern = new RegExp(protocols + uri)
var valid ='')
var invalid ='')
"valid is: ", valid,
"\ninvalid is: ", invalid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.