Skip to content

Instantly share code, notes, and snippets.

const regex = /^(?:https?:\/\/w*\.?)?([a-zA-Z0-9\.\-_]+)(?:[\/.\-_a-zA-Z0-9]*)$/;
const str = `https://test.google.com/testdsadsa`;
let m;
if ((m = regex.exec(str)) !== null) {
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
@Zetaphor
Zetaphor / window-cookie.js
Created August 15, 2016 18:56
Window Cookie Object
"atom-beautify":
prettyName: "Atom Beautify"
homepage: "https:/atom.io/packages/atom-beautify"
"atom-monokai":
prettyName: "Atom Monokai"
homepage: "https:/atom.io/packages/atom-monokai"
"atom-ternjs":
prettyName: "Atom Ternjs"
homepage: "https:/atom.io/packages/atom-ternjs"
"auto-detect-indentation":