* Kelder tried to resist using regex and failed miserably
:tongue: alias check {
if ($len($1) != $len($2)) return $false
var %t = $2, %i = $v1
while (%i) {
if (!$regsub(%t,/\Q $+ $mid($1,%i,1) $+ \E/[color:red]i,,%t)) return $false
dec %i
}
if (%t == $null) return $true
else return $false
}[/color]
usage:
echo -s $check(word,rodw)If the
i is present it's case insensitive, if you keep it out it's case sensitive.
Also make sure the code is really on different lines and not one long line (forum pasting bug)
(Thanks to Online for the tips

)