Re: extract URL from general text
Re: extract URL from general text
- Subject: Re: extract URL from general text
- From: "Enrique Terrazas" <email@hidden>
- Date: Tue, 18 Mar 2008 13:47:13 -0700
I need to extract valid "http" URL's from general (non-html) text.
I define what is valid as follows:
1. begins with "http:"
2. preceded by " "
3. followed by " "
4. containing only valid characters (or validly encoded characters)
as per RFC1738
Anybody have a script handy that might work or can be adapted?
H.
If you are willing and able to install three perl modules
(Mac::Pasteboard and URI::Find and URI::Find::Simple), this will give
you a return delimited list of url's in a text block that is present
on the clipboard:
set s to do shell script "perl -e 'use Mac::Pasteboard; use
URI::Find::Simple qw( list_uris ); print join(chr(10),
list_uris(pbpaste()));'"
You will have to strip out any potential URL's that begin with https://
Enrique Terrazas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden