Many apps need this code. So the idea.
Find URLs in the AnsiString and UnicodeString - without using RegEx.
By custom Pascal code.
First, search must find one of possible beginnings:
word boundary
one of words in lowercase: 'mailto:', 'http://', 'https://', 'ftp://' with the following word-char and with proper ending
If OK beginning exists, do the complex search for ending. Ending:
for 'mailto:' ending is set of word-chars, '@', dot, plus, minus, underscore
for http and https: ending is very complex, we must allow: port number after ":", "/" with following unix path, "?" with URL params, '#' with anchor-chars
for ftp: ending is much simpler than for http
Why the idea? Avoid slow search by RegEx. What do you think @rickard67 ?
Many apps need this code. So the idea. Find URLs in the AnsiString and UnicodeString - without using RegEx. By custom Pascal code. First, search must find one of possible beginnings:
If OK beginning exists, do the complex search for ending. Ending:
Why the idea? Avoid slow search by RegEx. What do you think @rickard67 ?