|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
|
|
|
Thinjon100 Apprentice
Joined: 12 Jul 2004 Posts: 190 Location: Canada
|
Posted: Sat Sep 29, 2007 5:44 pm |
If you write it in regex you can do it, I think... try:
you ({asking|exclaiming}?)
With the regular expression box checked. |
|
_________________ If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :) |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sat Sep 29, 2007 6:27 pm |
Well, the point of beta testing is to find bugs not workarounds!
But I might give it a go anyway. |
|
|
|
Thinjon100 Apprentice
Joined: 12 Jul 2004 Posts: 190 Location: Canada
|
Posted: Sat Sep 29, 2007 6:28 pm |
Aye, this I know... but I figured it wouldn't hurt to offer a tangible solution as well :)
|
|
_________________ If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :) |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sat Sep 29, 2007 6:35 pm |
Ah, I've found the actual bug: CMUD is generating the incorrect regular expression. It's not adding the | at the end:
CMUD v2.03:
you (asking |exclaiming |)
CMUD v2.04:
you (asking |exclaiming )
This is from the Test Pattern tab, where you can see the perl regex it is actually using. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Sep 29, 2007 6:51 pm |
Optional text and wildcards inside {these|things} are normally the two tipping points where I use a regex instead of a normal trigger. Thinjon's almost right - the proper regex is (asking|exclaiming)?.
|
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sat Sep 29, 2007 6:55 pm |
Is (asking |exclaiming )? more efficient then (asking |exclaiming |)?
Note that words are usually followed by spaces, and always in this case, so I have to match a space too when there is a word there. |
|
|
|
Thinjon100 Apprentice
Joined: 12 Jul 2004 Posts: 190 Location: Canada
|
Posted: Sat Sep 29, 2007 6:59 pm |
My apologies, Fang... forgot my parenthesis-brace discrimination... I always do that. :P
In your case, Seb, I'd recommend:
you\s((asking|exclaiming)\s)?
Unless I've slipped on my syntax again, this should read "capture the word 'asking' or 'exclaiming' followed by a single space, or nothing at all, after the word 'you' followed by a space.
There MAY be a necessity for a non-capture syntax in there, I'm not certain... but in that case I think it'd be:
you\s((?:asking|exclaiming)\s)? |
|
_________________ If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Sep 29, 2007 7:03 pm |
There's probably not a great deal of difference, since the regex moves from left to right through the possible options until one matches. The last one there matches (because it's empty), but the regex still has to go through the possibilities first. In the other one, the regex tries all the possibilities, but if none match, it carries on anyway.
I just hate how (some|thing|) looks - like you made a typo or missed an option out - especially when there's only one optional string. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 01, 2007 5:52 pm |
bug confirmed and added to bug list
|
|
|
|
|
|