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 

syntax checking of user input on a public trigger
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Mar 19, 2013 3:22 pm    Post subject: Reply with quote

Looking abit closer at the a|b|cd example, you also accept an empty string with your pattern.
That said, I just tested the relevant parts of your code, with my expression, and it works just fine for me.

Unfortunately, you can't get any error messages as for why your pattern didn't match your string. Regular expressions is a tedious game of trial, frustration, and error.

A few more remarks anyway;
There's no point in creating a bracket expression containing a single character, it just clutters your expression. Bracket expressions is best used to match a range of characters, such as a-z or 0-9.
Back references are powerful, but they can make the expression harder to follow. Especially when you place them within a bracket expression.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
LoKii
Voice


Joined: 21 Oct 2009
Posts: 34

PostPosted: Tue Mar 19, 2013 4:26 pm    Post subject: Reply with quote

Thanks for your insight on this. In this case, i will leave this thread as unsolved for the time being (although in current, it works as expected), and I will try to implement you recommendations. I will leave this part of the entire script to the last, since it seems that this regex will be very time consuming. ( I need to add various regex solutions to another 10 - 20 commands), so i will work on the regex in between as much as time allows and finish off all the non-regex things on my to-do list for now.

My main goal in this is to get rid of all the escapes, that would indeed make the regex syntax much shorter, and more readable.

Cheers Smile
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 -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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