Substitute



examples/regexes/substitute.cr
text = "ab  text. and $ and ^ also"
puts text
puts text.sub(/\W/, "")
puts text.gsub(/\W/, "")

ab  text. and $ and ^ also
ab text. and $ and ^ also
abtextandandalso