Usage: $filttok(TOKEN,RANGE,C)
Example: $filttok(a.b.c.d.e,b-c,46) will return a.d.e
As you can see, it works for both letters and numbers and will filter out the range.
alias filtok {
var %x = 1, %ftok = $1
while %x <= $numtok($1,$3) {
var %ftok = $iif($regex($gettok($1,%x,$3),/[ $+ $2 $+ ]/i),$remtok(%ftok,$gettok($1,%x,$3),1,$3),%ftok)
inc %x
}
return %ftok
}
Hmmm yeah. Maybe it would be good so the user could specify letters to filter via a comma, and recognise the last parameter used as the token.
Because if you use d-e for example that's like a range. I mean, what if you wanted to filter "a" and "z" together? You'd filter and get rid of the entire string!