[Freeswitch-dev] Lua session:playAndGetDigits regex

Robert Clayton rjcajax at gmail.com
Fri Mar 27 10:41:38 PDT 2009


As I understand it everything entered in square brackets(a character class)
is literal. In parentheses it is read as a metacharacter.

On Fri, Mar 27, 2009 at 2:48 AM, Even André Fiskvik <grevenx at me.com> wrote:

> 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
>
>
> _______________________________________________
> 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/7d81932d/attachment.html 


More information about the Freeswitch-dev mailing list