|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Feb 03, 2007 10:27 pm |
[ is a special character, it needs escaping with \ to create:
EDIT: Actually, that's not working either. I tried that regex, echoing [whatever manually and it wouldn't fire. |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Sun Feb 04, 2007 12:39 am |
I must have made a typo, because I meant to type a "\" before the [. So I meant that even with escaping the character it didn't work... which I thought was odd.
|
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Sun Feb 04, 2007 1:14 am |
Okay, so it sounds like Fang is seeing the same issue that I am if I'm understanding his edit correctly. The issue being that even when the brace is escaped it doesn't fire.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sun Feb 04, 2007 5:25 am |
I did some playing around with this and it seems tied to an issue with the parser looking for a closing bracket.
I tested with these triggers.
#REGEX {Test} {#show A Works}
#REGEX {[Test]} {#show B works}
#REGEX {[Test} {#show C works}
#SHOW "[Test] this"
#SHOW "[Test this"
#SHOW "[Test this] as well"
The first show command will fire all 3 triggers, the second and third show commands will only fire the first trigger.
[Edit] The problem holds true even if its not at the beginning of a line. |
|
_________________ Asati di tempari! |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Sun Feb 04, 2007 8:31 am |
Well I'm glad this could be verified and that I wasn't doing something dumb to cause it.
|
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Sun Feb 04, 2007 11:38 pm |
Here, as well--having a single (quoted) [ anywhere failed, having matched []s or a single ] works fine.
Having a single unquoted [ was treated like there was an invisible closing (unquoted) ] at the end. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Feb 05, 2007 8:12 pm |
Tech: aren't you missing some \ characters in your #REGEX patterns? I know that the forum bbcode will convert \ [ into just [ so maybe that was the problem. I think if you put it within a [code] bbcode tag then it won't strip them.
In any case, the [ *is* a special regular expression character. It is used to specify character ranges. So you *must* put a \ character before the [ in your pattern for anything to make sense.
I'm assuming that you used the \ and it was just the forums that messed up the post, because when I tried your examples and had the correct \ in front of each [ then it still failed just as you mentioned. So I've added this to the bug list. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Feb 06, 2007 12:40 am |
Yes I did use the \ before the [. I didn't even notice that they got stripped.
|
|
_________________ Asati di tempari! |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Tue Feb 06, 2007 1:03 am |
Ah, so I'm not going crazy, I did have it there and the forum stripped it without me noticing. I felt like an idiot when I looked back it wasn't escaped and I thought I had escaped it.
I did have a "\" before the "[" because I knew that braces are special characters for character ranges. |
|
|
|
|
|