egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

doubts wildcard in a string

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Wed Apr 06, 2016 7:24 pm    Post subject: doubts wildcard in a string Reply with quote

I need the code compare the first 4 characters of a string and if they are " ABC- " followed by 5 numeric characters either.
[string range $string 0 8] eq ABC-?????
How wildcards are used "? " ?
_________________
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks Smile
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Apr 06, 2016 10:08 pm    Post subject: Re: doubts wildcard in a string Reply with quote

See:
http://www.tcl.tk/man/tcl8.5/TclCmd/string.htm#M39


Examples:

<my_handle> .tcl string match "ABC-?????" "ABC-12345"
<botnick> Tcl: 1

<my_handle> .tcl string match "ABC-?????" "abc-12345"
<botnick> Tcl: 0

<my_handle> .tcl string match "ABC-?????" "ZYZ-12345"
<botnick> Tcl: 0


I hope this helps.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber