[Freeswitch-dev] Lua session:playAndGetDigits regex

Robert Clayton rjcajax at gmail.com
Fri Mar 27 08:09:48 PDT 2009


More succinctly how could I implement.

"Enter the six digit file number or press the asterisk key to restart and
enter again", assuming a person entered 3 digits got confused and wished to
enter the number again from the beginning?


2009/3/27 Brian West <brian at freeswitch.org>

> What exactly do you want to match?  Can you give me examples?
> /b
> On Mar 26, 2009, at 11:05 PM, 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
> Brian West
> brian at freeswitch.org
> -- Meet us a ClueCon!  http://www.cluecon.com
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20090327/0b416710/attachment.html 

More information about the Freeswitch-dev mailing list