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 

regexp

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


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue Jun 19, 2007 4:01 am    Post subject: regexp Reply with quote

Currently this is to check if a nickname contains "alphabetnumberalphabet" for ex:

abcd33ad or eekk556xnxn

Code:
if { [regexp -nocase {^[a-z]\d{1,}[a-z]$} $nick]} {


How can I make it scan only "alphabet2digits" for ex:

abcd12 or aaa33 or dniionoin99

So two digits in the end and alphabets in the start.
can you make me that experession.

Thanks
iamdeath
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Jun 19, 2007 5:02 am    Post subject: Reply with quote

^[[:alpha:]]+[[:digit:]]{2}$
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Tue Jun 19, 2007 6:59 am    Post subject: Reply with quote

nml375 wrote:
^[[:alpha:]]+[[:digit:]]{2}$


You can use this too:

Code:
if {[regexp -nocase {^[a-z]{3,}[0-9]{2}$} $nick]} { blah }

_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Jun 19, 2007 7:11 am    Post subject: Reply with quote

Not quite the same, as [:alpha:] covers all alphabet-characters, not only a-z...
Also, if you were to replace + with a {n,} construct, n should be one (1) and not three (3)
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Tue Jun 19, 2007 10:19 am    Post subject: Reply with quote

Thanks I'll give it a try.
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
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