in reply to String matching idea
Update: no code was requested, so using the spoiler tag:
If your strings only contain "a" and "b", you can use
index $s1 ^ $s2, "\03" [download]
directly, because "\03" eq ('a' ^ 'b').