[Freeswitch-dev] Lua session:playAndGetDigits regex

Even André Fiskvik grevenx at me.com
Thu Mar 26 23:48:13 PDT 2009


Imho you always have to escape the asterisk character if that is what  
you want,
so "[*]" is bad. You would want "[\*]".

See http://www.regular-expressions.info/characters.html for tips.


Best regards,

Even André

On 27. mars. 2009, at 05.05, Robert Clayton wrote:

> All,
>
> Ok I know it must be me but...
>
> In the Lua regex portion of session:playAndGetDigits what regex  
> would I use to match either a numeric entry, or an asterisk. It  
> seems when I attempt to define an asterisk as a character rather  
> than a metacharacter the regex script is evaluated other than I  
> would assume.
> The error code presents \* as a single * and [*] other than a  
> character, leading to the hint that there is no preceding character  
> to multiply.
>
> I have at most 15 minutes of proficiency in regular expressions,  
> but, are not \* or [*] equivalent to an asterisk character, rather  
> than a metacharacter?
>
> Also it seems that the playAndGetDigits evaluates when either the  
> maximum number of characters is entered or the terminator is  
> pressed. Is there any way to evaluate the regex on each input and  
> therefore dynamically return after an acceptable entry? As in the  
> previous example a numeric string and a single asterisk are,  
> usually, different lengths and if an asterisk was used for, say,  
> abort, entering an asterisk followed by a terminator would seem  
> incorrect.
>
> Bob
>
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org




More information about the Freeswitch-dev mailing list