This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

replacing digits by ? within a nick

Old posts that have not been replied to for several years.
Locked
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

replacing digits by ? within a nick

Post by z_one »

Hi,

What is the best code to use when replacing all digits within a nick by the interrogation mark.

Example:
Say I have the nick "Nick2356Name" and I want to ban "Nick????Name" thus automatically replacing all digits encountered by a "?"

Thanks in advance.

z_one
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I am not quite sure wat you are after, though this should work.

Code: Select all

set nick "nick1234name"
regsub -all -- {[0-9]} $nick "?" newnick
# $newnick now equals "nick????name"
Though say this relates to bans, which comes to a confusing point. IRC servers only use * as a wildcard, and ? will serve no purpose.
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

Though say this relates to bans, which comes to a confusing point. IRC servers only use * as a wildcard, and ? will serve no purpose.
Dunno about other networks (maybe you're right) but on DALnet the "?" matches a single character in a ban.
Thus if you ban d?ck!*@* then both deck and duck nicks won't be able to join your channel.

Thanks for your help, I'll try the code asap :)

z_one
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

ppslim wrote:I am not quite sure wat you are after, though this should work.

Code: Select all

set nick "nick1234name"
regsub -all -- {[0-9]} $nick "?" newnick
# $newnick now equals "nick????name"
Though say this relates to bans, which comes to a confusing point. IRC servers only use * as a wildcard, and ? will serve no purpose.

Don't know what networks you've been using, but all I've used (Undernet, EFNet, dalnet, etc..) support the "?" single character matching token.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I don't know if this is true.

I tried making a few tests about 15 months back, when I was doing some work on testing and implimenting some new stuff into no-spam, and for another script, that was designed to inteligently pick a hostmask from a user.

On EFnet, I found that only the * worked.

Now, with the use of the 2 IRCD's (comstud and hybrid), there may be a differance, and on top, it would vary from server to server.

I gave up work on this, plainly due to the fact, that I couldn't test it, and if the support wasn't in 1 of the big 4 networks, then is was pointless.
Locked