| View previous topic :: View next topic |
| Author |
Message |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Mar 19, 2013 3:22 pm Post subject: |
|
|
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 |
|
 |
LoKii Voice
Joined: 21 Oct 2009 Posts: 34
|
Posted: Tue Mar 19, 2013 4:26 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
|
|
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
|
|