Find URI in text: Difference between revisions

Content added Content deleted
m (how does mediawiki handle the )?)
(because we can :-))
Line 16: Line 16:
this URI contains an illegal character, parentheses and a misplaced full stop:
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/).
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://rosettacode.org/wiki/User:EMBee/Because_we_can_:-)


Regular expressions to solve the task are fine, but alternative approaches are welcome too. (otherwise, this task would degrade into 'how to apply a regular expression')
Regular expressions to solve the task are fine, but alternative approaches are welcome too. (otherwise, this task would degrade into 'how to apply a regular expression')
Line 21: Line 22:
=={{header|Pike}}==
=={{header|Pike}}==
<lang Pike>string uritext = "this URI contains an illegal character, parentheses and a misplaced full stop:"
<lang Pike>string uritext = "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/).";
"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://rosettacode.org/wiki/User:EMBee/Because_we_can_:-)";


array find_uris(string uritext)
array find_uris(string uritext)