| View previous topic :: View next topic |
| Author |
Message |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Mon Feb 23, 2009 8:59 am Post subject: Check if nickname is caps lock |
|
|
Hi, I'm trying to make a script that kicks users with caps lock on their nick, and to do that, I tried this:
| Code: |
if {[regexp {[A-Z]} $nick]} { KICK blah blah blah... }
|
And it DOES work with caps lock nicks, but it also kicks users which have a nickname like "IamYou" (I mean, some capital letters in the middle), and I just want it to detect nicknames with caps lock on all of the letters.
Could you help me with this please? |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Mon Feb 23, 2009 9:39 am Post subject: |
|
|
try:
| Code: | | [regexp {^[A-Z]+$} $nick] |
|
|
| Back to top |
|
 |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Mon Feb 23, 2009 2:05 pm Post subject: |
|
|
worked
thanks.
But could you explain me what is that command? I wanted to learn it
Once again, thanks. |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Mon Feb 23, 2009 3:01 pm Post subject: |
|
|
^ [A-Z]+ $
in this case:
^ - beginning of string
$ - end of string
[A-Z] - set of chars
+ - previous char/set of chars could occur one or more times
Its rly weird.
Better go and study some good tutorial (no offense) |
|
| Back to top |
|
 |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Wed Feb 25, 2009 5:10 am Post subject: |
|
|
yeap, it's weird, thanks for the info., I'll search for a good tutorial.
Once again, thanks  |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Feb 25, 2009 1:15 pm Post subject: |
|
|
Personally, I don't find regular expressions that weird, just a little overwhelming when you deal with them for the first time.
Have a look at the "Regular expression syntax" manpage. I believe you'll find it helpful when dealing with regular expressions. Another good resource would be http://www.regular-expressions.info/tutorial.html _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Fill Halfop
Joined: 18 Jan 2009 Posts: 80
|
Posted: Sat Feb 28, 2009 6:11 pm Post subject: |
|
|
| thanks, great guides!!! |
|
| Back to top |
|
 |
|