Find URI in text: Difference between revisions

m
(→‎Tcl: Added implementation)
m (→‎{{header|Tcl}}: add comment)
Line 245:
This uses regular expressions to do the matching. It doesn't match a URL without a scheme (too problematic in general text) and it requires more than ''just'' the scheme too, but apart from that it matches slightly too broad a range of strings (though not usually problematically much). Matches some IRIs correctly too, but does not tackle the <tt>&lt;bracketed&gt;</tt> form (especially not if it includes extra spaces).
<lang tcl>proc findURIs {text args} {
# This is an ERE with embedded comments. Rare, but useful with something
# this complex.
set URI {(?x)
[a-z][-a-z0-9+.]*: # Scheme...
Anonymous user