Magik (programming language): Difference between revisions

Content deleted Content added
No edit summary
Line 183:
write("Got a match!")
_endif
</pre>
 
and to capture groups in Regex:
 
<pre>
/sw([0-9]+)-([0-9]+).*/.replace_all("sw65456-324sss", "$1") # "65456"
/sw([0-9]+)-([0-9]+).*/.replace_all("sw65456-324sss", "$2") # "324"
</pre>