Find URI in text: Difference between revisions

m
m (→‎{{header|Phix}}: updated to handle mismatched brackets and trailing full stop)
m (→‎{{header|Wren}}: Minor tidy)
 
(One intermediate revision by one other user not shown)
Line 622:
=={{header|Phix}}==
The following is based on scanForUrls() in demo\edita\src\easynclr.e which is used/tested on a daily basis and may get additional bugfixes, though it is quite strongly coupled in with syntax colouring and other editor gubbins. Now handles dangling ")" and trailing "." to match the mediawiki handling, with Edita (1.0.4) similarly updated. Note that Edita does not highlight a quoted text literal in the same manner as medaiwiki, but does with comments.<br>
Deliberately handles IRI but not URI, onin other words no attempt is made to prohibit unicode characters.
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
Line 1,149:
{{libheader|Wren-pattern}}
Wren's simple pattern matcher lacks the sophistication of regular expressions and I've had to make considerable simplifications to the search pattern needed for complete URI/IRI matching whilst still doing enough to identify the ones embedded in the sample text for this task.
<syntaxhighlight lang="ecmascriptwren">import "./pattern" for Pattern
 
var text = """
9,488

edits