Hi,
I tried some hours here and there to find a working way to "highlight" the matching parts of a %wildcard.mask in a $fulladdress (nick!ident@host.domain)
I sampled (and failed) cycling the parts nick ident host with $mid $len $pos and the like...
$regsub seems to be the most promising approach.

I managed (trial and error, to be honest) simple replaces like:
Code:
//var %test | noop $regsub(teststring,/s.+in/gi,8s*in,%test) |  echo -a %test
or
Code:
//var %text = some!test@string | echo -a $regsubex(%text,/(ome.*!.*st)/gi,$+($chr(3),07\t,$chr(15)))

... but in fact, I am quite green with $regsub, therefore I need some skilled help smile


The goal is to visualize the matching parts of a "full" %wildcard.mask (not an shortened *@host.domain or the like, maybe thats important for error handling) in some $fulladdress in two ways:
1) highlight matching "text" in some colour 1
2) highlight "text met by wildcards" in some other colour 2

e.g.: to make the parts of "nic*!user@*.doma*n" in "nick!user@host.domain" become: "nick!user@host.domain"

Some problems I anticipate are:

a)
[can be resolved by a simple $replace in the beginning, but maybe this gotta be done in the $regsub somewhere, too]
Escape possible metachars [ ] { } ^ | \ . * (which may be part of addresses and banmasks) with \[ \] \{ \} \^ \| \\ \. .*

b)
Stop regex comparison at ! and @ - as wildcards in masks like banmasks stop there, too

c)
If a part of the $fulladdress is already "met" (coloured) by a wilcard, but met exactly by more parts of the %wildcard.mask, the exact match shall have priority.
e.g.:

A highlighting of "A-test-nick!apple@pie" compared to "*t*!tomato@*"

shall higlight as:
A-test-nick!apple@pie

and not as:
A-test-nick!apple@pie

Thoughts:
I played with separating the $fulladdress and %wildcard.mask into its components (nick-user-host) to avoid b)
There is also no need to make the $regsub as neat or short as possible, working code is what really counts smile


Thx a lot in advance!