Anonymous user
Find URI in text: Difference between revisions
→{{header|Pike}}: update test input
m (→{{header|Icon}} and {{header|Unicon}}: tweak comment) |
(→{{header|Pike}}: update test input) |
||
Line 158:
=={{header|Pike}}==
<lang Pike>string uritext = #"this URI contains an illegal character, parentheses and a misplaced full stop:
which is handled by http://mediawiki.org/).
\")\" 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)
if you have other interesting URIs for testing, please add them here:";
array find_uris(string uritext)
Line 183 ⟶ 191:
find_uris(uritext);
Result: ({ /*
"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?punct/uation",
"ftp://domain.name/dangling_close_paren)"
})</lang>
|