Questions tagged [gruber]

5 questions
10
votes
3 answers

Help Hacking Gruber's Liberal URL Regex

I've taken the Liberal URL Regex from Daring Fireball, merged it with some of Alan Storm improvements and hacked my way into fixing some bugs like support for IDN chars inside parentheses. This is what…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
8
votes
1 answer

How do I fix "invalid group" error when attempting to use Gruber's "improved" URL matching regexp pattern in JavaScript?

I'm attempting to integrate John Gruber's An Improved Liberal, Accurate Regex Pattern for Matching URLs into one of my Javascripts, but WebKit's inspector (in Google Chrome 5.0.375.125 for Mac) gives an "Invalid group" regular expression syntax…
morgant
  • 2,135
  • 2
  • 19
  • 28
5
votes
1 answer

Url Matching using Gruber's regex in PHP

how do I get the regex mentioned in this article working with preg_match in php? ]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))/i", $text, $matches); print_r($matches); ?> Using the code above I get the…
navitronic
  • 563
  • 3
  • 15
5
votes
3 answers

Gruber’s URL Regular Expression in Python

How do I rewrite this new way to recognise addresses to work in Python? \b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))
Tobias
  • 3,882
  • 2
  • 22
  • 25
2
votes
1 answer

Optimize Gruber URL regex for Javascript

I've been using John Gruber's great URL regex for matching URLs in unstructured text messages. It works fantastically most of the time, but I've found a case in which performance degrades severely depending on the content inside of a parentheses. …
justind
  • 1,259
  • 13
  • 16