Regular expressions: Difference between revisions

(Added PicoLisp)
Line 397:
5
a not b ot c
</pre>
 
=={{header|MIRC Scripting Language}}==
<lang mirc>alias regular_expressions {
var %string = This is a string
var %re = string$
if ($regex(%string,%re) > 0) {
echo -a Ends with string.
}
%re = \ba\b
if ($regsub(%string,%re,another,%string) > 0) {
echo -a Result 1: %string
}
%re = \b(another)\b
echo -a Result 2: $regsubex(%string,%re,yet \1)
}</lang>
 
Output:
<pre>
Ends with string.
Result 1: This is another string
Result 2: This is yet another string
</pre>
 
Anonymous user