RosettaCodeData/Task/Regular-expressions/Nim/regular-expressions.nim
2016-12-05 23:44:36 +01:00

9 lines
141 B
Nim

import re
var s = "This is a string"
if s.find(re"string$") > -1:
echo "Ends with string."
s = s.replace(re"\ a\ ", " another ")
echo s