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.
Help for those learning Tcl or writing their own scripts.
iamdeath
Master
Posts: 323 Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:
Post
by iamdeath » Tue Jun 19, 2007 4:01 am
Currently this is to check if a nickname contains "alphabetnumberalphabet" for ex:
abcd33ad or eekk556xnxn
Code: Select all
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*...
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Jun 19, 2007 5:02 am
^[[:alpha:]]+[[:digit:]]{2}$
NML_375
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Tue Jun 19, 2007 6:59 am
nml375 wrote: ^[[:alpha:]]+[[:digit:]]{2}$
You can use this too:
Code: Select all
if {[regexp -nocase {^[a-z]{3,}[0-9]{2}$} $nick]} { blah }
r0t3n @ #r0t3n @ Quakenet
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Tue Jun 19, 2007 7:11 am
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
iamdeath
Master
Posts: 323 Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:
Post
by iamdeath » Tue Jun 19, 2007 10:19 am
Thanks I'll give it a try.
|AmDeAtH @ Undernet
Death is only the *Beginning*...