| View previous topic :: View next topic |
| Author |
Message |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Tue Jun 19, 2007 4:01 am Post subject: regexp |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Jun 19, 2007 5:02 am Post subject: |
|
|
^[[:alpha:]]+[[:digit:]]{2}$ _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Tue Jun 19, 2007 6:59 am Post subject: |
|
|
| 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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Jun 19, 2007 7:11 am Post subject: |
|
|
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 |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Tue Jun 19, 2007 10:19 am Post subject: |
|
|
Thanks I'll give it a try. _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
|