##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: October 2016 # Modified: 2016-10-09/17:34-0400 ##+ # # match.icn, demonstrate string scanning match # procedure main() s := "this is a test" # match will return the index after the matched string s ? this := match("this") write(this) # no match, variable that remains null, no write s ? that := match("that") write(\that) # match is built into the unary equal operator as tab(match(s)) s ? data := ="this" write(":", data, ":") # equivalent to s ? data := tab(match("this")) write(":", data, ":") end