|
July 5th, 2001
The function CaptureLinks presented here can be used to capture all hyperlinks from a string.
Description
Use this function if to retireve an array of hyperlinks that are captured from a given string. For example, if you pass:
- this is a test <a href="http://www.string.com">string</a> with a local, unquoted <a href=c:\localdirectory\file.txt>link</a>
to the function, it will return an array of two elements:
- http://www.string.com
- c:\localdirectory\file.txt
Test the code!
Note that the function allows for both quoted and unquoted links. However, unquoted links cannot contain white spaces, i.e. only the portion up to the first white space will be captured. If nothing is captured, an empty string is returned.
|