Viewing post #1320328 by dave

You are viewing a single post made by dave in the thread called Non-functioning links to articles.
Image
Nov 18, 2016 8:36 AM CST
Garden.org Admin
Name: Dave Whitinger
Southlake, Texas (Zone 8a)
Region: Texas Seed Starter Vegetable Grower Tomato Heads Vermiculture Garden Research Contributor
Million Pollinator Garden Challenge Charter ATP Member I was one of the first 300 contributors to the plant database! Garden Ideas: Master Level Region: Ukraine Garden Sages
This is the regular expression I'm currently using:

$url = '#(^|[\n (])([\w]+?://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])#is';

It does have the unfortunate side effect of including the trailing ) as part of the URL. I'm not sure what the right solution is, given that parenthesis in URLs are valid and legal. How can the system be programmed to know whether you intended that character to be a part of the URL, or rather the end of a sentence?

« Return to the thread "Non-functioning links to articles"
« Return to Site Talk forum
« Return to the Garden.org homepage

Member Login:

( No account? Join now! )

Today's site banner is by RootedInDirt and is called "Angel Trumpet"

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.