Skip to content

Instantly share code, notes, and snippets.

View OleMchls's full-sized avatar
🎯
Focusing

Ole Michaelis OleMchls

🎯
Focusing
View GitHub Profile
@lrytz
lrytz / z-automator.png
Last active February 4, 2023 21:20
Shortcut for Syntax Highlighting in Keynote
//Gruber wrote this regex for matching URLs, but it took a small amount of massage to use it in JavaScript. So here.
//Sauce: http://daringfireball.net/2010/07/improved_regex_for_matching_urls
var p = /\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
p.exec('party fun www.twitter.com yay') //winning.