Find URI in text: Difference between revisions

added Perl 6 section
(→‎{{header|REXX}}: added the REXX language. -- ~~~~)
(added Perl 6 section)
Line 193:
foo://domain.hld/
</pre>
 
=={{header|Perl 6}}==
This needs an installed URI distribution. {{works with|Rakudo"}}
<lang perl6>use v6;
use IETF::RFC_Grammar::URI;
 
say q:to/EOF/.match(/ <IETF::RFC_Grammar::URI::absolute_URI> /, :g).list.join("\n");
this URI contains an illegal character, parentheses and a misplaced full stop:
http://en.wikipedia.org/wiki/Erich_Kästner_(camera_designer). (which is handled by http://mediawiki.org/).
and another one just to confuse the parser: http://en.wikipedia.org/wiki/-)
")" is handled the wrong way by the mediawiki parser.
ftp://domain.name/path(balanced_brackets)/foo.html
ftp://domain.name/path(balanced_brackets)/ending.in.dot.
ftp://domain.name/path(unbalanced_brackets/ending.in.dot.
leading junk ftp://domain.name/path/embedded?punct/uation.
leading junk ftp://domain.name/dangling_close_paren)
EOF
</lang>
 
Like most of the solutions here it does not comply to IRI but only to URI:
 
<pre>stop:
http://en.wikipedia.org/wiki/Erich_K
http://mediawiki.org/).
parser:
http://en.wikipedia.org/wiki/-)
ftp://domain.name/path(balanced_brackets)/foo.html
ftp://domain.name/path(balanced_brackets)/ending.in.dot.
ftp://domain.name/path(unbalanced_brackets/ending.in.dot.
ftp://domain.name/path/embedded
ftp://domain.name/dangling_close_paren)</pre>
 
=={{header|Pike}}==
Anonymous user