[Freeswitch-dev] Lua session:playAndGetDigits regex
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
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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
As I understand it everything entered in square brackets(a character class) is literal. In parentheses it is read as a metacharacter.
Character classes have their own rules. I don't recommend using them unless you know precisely what you are doing. I like Brian's regex of "(\*|\d{6})" In brackets you have interesting things, like dashes not always being dashes and a leading caret meaning negation. [^A-Z] <== what does this mean? ;) In any case, check the regular expressions page on the wiki for more online resources. -MC
Michael, I liked "(\*|\d{6})" also but when entered in: agent_id = session:playAndGetDigits(1, 3, 2, 10000,'#', 'c:/DictationProject/audio/Validating.wav', '', "(\*|\d{6})"); Creates the error: 2009-03-27 14:05:36 [ERR] switch_regex.c:184 switch_regex_match_partial() Regula r Expression Error expression[(*|d{6})] error[nothing to repeat] location[1] The escape characters seem to disappear and FS attempts to use the, /* an asterisk character, as * a metecharacter. Bob On Fri, Mar 27, 2009 at 2:02 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
As I understand it everything entered in square brackets(a character class) is literal. In parentheses it is read as a metacharacter.
Character classes have their own rules. I don't recommend using them unless you know precisely what you are doing. I like Brian's regex of "(\*|\d{6})"
In brackets you have interesting things, like dashes not always being dashes and a leading caret meaning negation.
[^A-Z] <== what does this mean? ;)
In any case, check the regular expressions page on the wiki for more online resources. -MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
I liked "(\*|\d{6})" also but when entered in:
agent_id = session:playAndGetDigits(1, 3, 2, 10000,'#', 'c:/DictationProject/audio/Validating.wav', '', "(\*|\d{6})");
Creates the error:
2009-03-27 14:05:36 [ERR] switch_regex.c:184 switch_regex_match_partial() Regula r Expression Error expression[(*|d{6})] error[nothing to repeat] location[1]
The escape characters seem to disappear and FS attempts to use the, /* an asterisk character, as * a metecharacter.
for kicks try it with only one or the other, that is, with only (\d{6}) or with only (\*) and see if you get that error. I'm curious where it's bombing out. I think that test will help us figure out what is going on. -MC
Michael, Simple Working Reference: agent_id = session:playAndGetDigits(1, 6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "23"); Entering 45 returned nothing as expected, entering 23 returned 23 as expected. ------------------------------------------------------------------------- Literal asterisk using parentheses: agent_id = session:playAndGetDigits(1, 6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "(\*)"); Entering a single asterisk and waiting for timeout, and the timeout occurred as expected. Error created: 2009-03-27 14:59:47 [ERR] switch_regex.c:184 switch_regex_match_partial() Regular Expression Error expression[(*)] error[nothing to repeat] location[1] Entering a single asterisk and a terminating #, the asterisk created an immediate timeout as expected. Error created: 2009-03-27 15:00:26 [ERR] switch_regex.c:184 switch_regex_match_partial() Regular Expression Error expression[(*)] error[nothing to repeat] location[1] ------------------------------------------------------------------------- Literal asterisk without parentheses: agent_id = session:playAndGetDigits(1, 3, 2, 10000,'#', 'c:/DictationProject/audio/Validating.wav', '', "\*"); Entering a single asterisk and waiting for timeout, and the timeout occurred as expected. Error created: 2009-03-27 15:02:14 [ERR] switch_regex.c:184 switch_regex_match_partial() Regular Expression Error expression[*] error[nothing to repeat] location[0] Entering a single asterisk and a terminating #, the asterisk created an immediate timeout as expected. Error created: 2009-03-27 15:02:58 [ERR] switch_regex.c:184 switch_regex_match_partial() Regular Expression Error expression[*] error[nothing to repeat] location[0] ------------------------------------------------------------------------- The error message correctly denoted the proper positions if the asterisk is being evaluated as a metacharacter, as well as looking for something to repeat. Bob On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
I liked "(\*|\d{6})" also but when entered in:
agent_id = session:playAndGetDigits(1, 3, 2, 10000,'#', 'c:/DictationProject/audio/Validating.wav', '', "(\*|\d{6})");
Creates the error:
2009-03-27 14:05:36 [ERR] switch_regex.c:184 switch_regex_match_partial() Regula r Expression Error expression[(*|d{6})] error[nothing to repeat] location[1]
The escape characters seem to disappear and FS attempts to use the, /* an asterisk character, as * a metecharacter.
for kicks try it with only one or the other, that is, with only (\d{6}) or with only (\*) and see if you get that error. I'm curious where it's bombing out. I think that test will help us figure out what is going on. -MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Michael, Also note the error message reprints the expression without the escape. Bob On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
I liked "(\*|\d{6})" also but when entered in:
agent_id = session:playAndGetDigits(1, 3, 2, 10000,'#', 'c:/DictationProject/audio/Validating.wav', '', "(\*|\d{6})");
Creates the error:
2009-03-27 14:05:36 [ERR] switch_regex.c:184 switch_regex_match_partial() Regula r Expression Error expression[(*|d{6})] error[nothing to repeat] location[1]
The escape characters seem to disappear and FS attempts to use the, /* an asterisk character, as * a metecharacter.
for kicks try it with only one or the other, that is, with only (\d{6}) or with only (\*) and see if you get that error. I'm curious where it's bombing out. I think that test will help us figure out what is going on. -MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH. -MC
Michael, Good start! We are getting warmer. Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc. Bob On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
try /^([\d*]{6})$/ \d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string. 2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org>wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Anthony, You are a good man. Early in the morning and up working. Though not presenting an error these versions return no results. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([\d*]{6})$"); agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([\\d*]{6})$"); agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([0-9]{6})$"); 123456, 12345, 1234, 123, 12, 1 NO --------------------------------------------------------- Likewise the following does not return anything. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "[\d*]{6}"); But the following works as expected. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "[0-9]{6}"); 12345 NO 123456 YES --------------------------------------------------------- But some good news, per Michael assuming interaction between Lua and FS this works. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "[\\d\*]{6}"); But this does not. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([\\d\*]{6})$"); Go figure. I will continue to experiment. Now let's see is this inductive or deductive programming? --------------------------------------------------------- As a side note, when this gets worked out I am not sure if this answers my other problem. If I wished for, say, "enter 6 numeric digits or an asterisk to allow reentry", is there any way to allow for an immediate response for either 6 numeric digits or a single asterisk without the requirement of a terminator. Bob 2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org>wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Or to be more specific: As a side note, when this gets worked out I am not sure if this answers my other problem. If I wished for, say, "enter 6 numeric digits or an asterisk to allow reentry." Is there any way to allow for an immediate response for either 6 consecutive numeric digits or an asterisk, singularly entered, or embedded in a numeric input, without the requirement for a terminating character? On Sat, Mar 28, 2009 at 9:48 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Anthony,
You are a good man. Early in the morning and up working.
Though not presenting an error these versions return no results.
agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([\d*]{6})$"); agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([\\d*]{6})$"); agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([0-9]{6})$");
123456, 12345, 1234, 123, 12, 1 NO ---------------------------------------------------------
Likewise the following does not return anything. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "[\d*]{6}");
But the following works as expected. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "[0-9]{6}");
12345 NO 123456 YES ---------------------------------------------------------
But some good news, per Michael assuming interaction between Lua and FS this works. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "[\\d\*]{6}");
But this does not. agent_id = session:playAndGetDigits(1,6, 2, 10000,"#", "c:/DictationProject/audio/Validating.wav", "", "^([\\d\*]{6})$");
Go figure. I will continue to experiment. Now let's see is this inductive or deductive programming? ---------------------------------------------------------
As a side note, when this gets worked out I am not sure if this answers my other problem. If I wished for, say, "enter 6 numeric digits or an asterisk to allow reentry", is there any way to allow for an immediate response for either 6 numeric digits or a single asterisk without the requirement of a terminator.
Bob
2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org>wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Well, I hope that this thread has not died as it seems there has been no solution. Also, it seems there is not a solid understanding as to the interaction between Lua and FS. Does this suggest that I should abandon Lua for another scripting implementation such as JavaScript? 2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>:
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
how about leave the regex blank if you can't figure one out and just collect 6 digits and look for * yourself? The one I told you saturday works for what you asked about. the one you came back and asked about would require a | (or) with 2 expressions. On Mon, Mar 30, 2009 at 7:20 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Well, I hope that this thread has not died as it seems there has been no solution. Also, it seems there is not a solid understanding as to the interaction between Lua and FS.
Does this suggest that I should abandon Lua for another scripting implementation such as JavaScript?
2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>:
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers
anything
goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the
escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org
wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Anthony, Yes and no. The original regex was a little more complex, it only got simplified in the thread while trying to discover what was going wrong. Where we got "\\*|\\d{6}" to match either a "*" or "123456" the original problem. It also allowed any entry if a single (or multiple) asterisk were entered at any position in the entry string. Which would be an incorrect action. Correct: * and 123456 and does not match 1234 Incorrect: **, *123, 123 *, 12*24, 12**34, 1*2*3, etc. Regardless, this was an interim step. What I need is two actions, the first FS easily allows, the second the complicating factor. 1) Enter either a numeric string (either a defined length or undefined length followed by a "#") 2) Enter an asterisk at anytime to allow reentry from the beginning (returning without requiring a following terminator) I tried to use the callback and filter the input myself but since (I think) the callback only functions while the recording is playing that could not be done unless I was sure either the user responded during the recording or the recording was paused. Is there anyway for the the callback to delay and not return at the end of the recording? Bob 2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
how about leave the regex blank if you can't figure one out and just collect 6 digits and look for * yourself? The one I told you saturday works for what you asked about. the one you came back and asked about would require a | (or) with 2 expressions.
On Mon, Mar 30, 2009 at 7:20 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Well, I hope that this thread has not died as it seems there has been no solution. Also, it seems there is not a solid understanding as to the interaction between Lua and FS.
Does this suggest that I should abandon Lua for another scripting implementation such as JavaScript?
2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>:
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
Michael,
Also note the error message reprints the expression without the escape.
Bob
On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins <msc@freeswitch.org> wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
try this, go to latest trunk, set the terminators to both # and * "#*" then when it stops check the variable read_terminator_used to see if it was # or * then you can continue in your loop i added the channel var read_terminator_used which should contain On Mon, Mar 30, 2009 at 10:42 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Anthony,
Yes and no. The original regex was a little more complex, it only got simplified in the thread while trying to discover what was going wrong. Where we got "\\*|\\d{6}" to match either a "*" or "123456" the original problem. It also allowed any entry if a single (or multiple) asterisk were entered at any position in the entry string. Which would be an incorrect action.
Correct: * and 123456 and does not match 1234 Incorrect: **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Regardless, this was an interim step. What I need is two actions, the first FS easily allows, the second the complicating factor. 1) Enter either a numeric string (either a defined length or undefined length followed by a "#") 2) Enter an asterisk at anytime to allow reentry from the beginning (returning without requiring a following terminator)
I tried to use the callback and filter the input myself but since (I think) the callback only functions while the recording is playing that could not be done unless I was sure either the user responded during the recording or the recording was paused. Is there anyway for the the callback to delay and not return at the end of the recording?
Bob
2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
how about leave the regex blank if you can't figure one out and just collect 6 digits and look for * yourself? The one I told you saturday works for what you asked about. the one you came back and asked about would require a | (or) with 2 expressions.
On Mon, Mar 30, 2009 at 7:20 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Well, I hope that this thread has not died as it seems there has been no solution. Also, it seems there is not a solid understanding as to the interaction between Lua and FS.
Does this suggest that I should abandon Lua for another scripting implementation such as JavaScript?
2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>:
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so
[\d*]
means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org
wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>: > Michael, > > Also note the error message reprints the expression without the > escape. > > Bob > > On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins > <msc@freeswitch.org> > wrote:
That just hit me. Try "\\*" instead of "\*" to see if maybe the backslash is getting dropped off between Lua and FreeSWITCH.
-MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:
http://lists.freeswitch.org/mailman/options/freeswitch-dev
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com<MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org<sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Anthony, Thanks. Great idea. My fallback was to use * as a terminator and only allow fixed size input. This is much better. What do you know I just lost the hard drive on my test system. With my scripts. I will reconstruct an begin soon By the way I get an error in LUA on my windows build. "error C2695: 'LUA::Session::destroy': overriding virtual function differs from 'CoreSession::destroy' only by calling convention c:\fs\src\mod\languages\mod_lua\freeswitch_lua.h 26 mod_lua" Bob 2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
try this,
go to latest trunk,
set the terminators to both # and * "#*" then when it stops check the variable read_terminator_used to see if it was # or * then you can continue in your loop
i added the channel var read_terminator_used which should contain
On Mon, Mar 30, 2009 at 10:42 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Anthony,
Yes and no. The original regex was a little more complex, it only got simplified in the thread while trying to discover what was going wrong. Where we got "\\*|\\d{6}" to match either a "*" or "123456" the original problem. It also allowed any entry if a single (or multiple) asterisk were entered at any position in the entry string. Which would be an incorrect action.
Correct: * and 123456 and does not match 1234 Incorrect: **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Regardless, this was an interim step. What I need is two actions, the first FS easily allows, the second the complicating factor. 1) Enter either a numeric string (either a defined length or undefined length followed by a "#") 2) Enter an asterisk at anytime to allow reentry from the beginning (returning without requiring a following terminator)
I tried to use the callback and filter the input myself but since (I think) the callback only functions while the recording is playing that could not be done unless I was sure either the user responded during the recording or the recording was paused. Is there anyway for the the callback to delay and not return at the end of the recording?
Bob
2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
how about leave the regex blank if you can't figure one out and just collect 6 digits and look for * yourself? The one I told you saturday works for what you asked about. the one you came back and asked about would require a | (or) with 2 expressions.
On Mon, Mar 30, 2009 at 7:20 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Well, I hope that this thread has not died as it seems there has been no solution. Also, it seems there is not a solid understanding as to the interaction between Lua and FS.
Does this suggest that I should abandon Lua for another scripting implementation such as JavaScript?
2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>:
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org> wrote: > > 2009/3/27 Robert Clayton <rjcajax@gmail.com>: > > Michael, > > > > Also note the error message reprints the expression without the > > escape. > > > > Bob > > > > On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins > > <msc@freeswitch.org> > > wrote: > > That just hit me. Try "\\*" instead of "\*" to see if maybe the > backslash is getting dropped off between Lua and FreeSWITCH. > > -MC > > _______________________________________________ > Freeswitch-dev mailing list > Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Anthony, I did not want you to think I did not appreciate this addition. I just have not been able to grab a clean build yet to test yet. But when I grab a clean build I will test it. Bob 2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
try this,
go to latest trunk,
set the terminators to both # and * "#*" then when it stops check the variable read_terminator_used to see if it was # or * then you can continue in your loop
i added the channel var read_terminator_used which should contain
On Mon, Mar 30, 2009 at 10:42 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Anthony,
Yes and no. The original regex was a little more complex, it only got simplified in the thread while trying to discover what was going wrong. Where we got "\\*|\\d{6}" to match either a "*" or "123456" the original problem. It also allowed any entry if a single (or multiple) asterisk were entered at any position in the entry string. Which would be an incorrect action.
Correct: * and 123456 and does not match 1234 Incorrect: **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Regardless, this was an interim step. What I need is two actions, the first FS easily allows, the second the complicating factor. 1) Enter either a numeric string (either a defined length or undefined length followed by a "#") 2) Enter an asterisk at anytime to allow reentry from the beginning (returning without requiring a following terminator)
I tried to use the callback and filter the input myself but since (I think) the callback only functions while the recording is playing that could not be done unless I was sure either the user responded during the recording or the recording was paused. Is there anyway for the the callback to delay and not return at the end of the recording?
Bob
2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
how about leave the regex blank if you can't figure one out and just collect 6 digits and look for * yourself? The one I told you saturday works for what you asked about. the one you came back and asked about would require a | (or) with 2 expressions.
On Mon, Mar 30, 2009 at 7:20 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Well, I hope that this thread has not died as it seems there has been no solution. Also, it seems there is not a solid understanding as to the interaction between Lua and FS.
Does this suggest that I should abandon Lua for another scripting implementation such as JavaScript?
2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>:
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com>
Michael,
Good start! We are getting warmer.
Where "(\\*|\\d{6})" will not match either * or 123456 or anything I can think of. "\\*|\\d{6}" does match * and 123456 and does not match 1234 So far so good. BUT, if an asterisk(s) are entered in a combination with numbers anything goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Bob
On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins <msc@freeswitch.org> wrote: > > 2009/3/27 Robert Clayton <rjcajax@gmail.com>: > > Michael, > > > > Also note the error message reprints the expression without the > > escape. > > > > Bob > > > > On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins > > <msc@freeswitch.org> > > wrote: > > That just hit me. Try "\\*" instead of "\*" to see if maybe the > backslash is getting dropped off between Lua and FreeSWITCH. > > -MC > > _______________________________________________ > Freeswitch-dev mailing list > Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
let me know if it works On Thu, Apr 2, 2009 at 1:54 PM, Robert Clayton <rjcajax@gmail.com> wrote:
Anthony,
I did not want you to think I did not appreciate this addition. I just have not been able to grab a clean build yet to test yet. But when I grab a clean build I will test it.
Bob
2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
try this,
go to latest trunk,
set the terminators to both # and * "#*" then when it stops check the variable read_terminator_used to see if it was # or * then you can continue in your loop
i added the channel var read_terminator_used which should contain
On Mon, Mar 30, 2009 at 10:42 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Anthony,
Yes and no. The original regex was a little more complex, it only got simplified in the thread while trying to discover what was going wrong. Where we got "\\*|\\d{6}" to match either a "*" or "123456" the original problem. It also allowed any entry if a single (or multiple) asterisk were entered at any position in the entry string. Which would be an incorrect action.
Correct: * and 123456 and does not match 1234 Incorrect: **, *123, 123 *, 12*24, 12**34, 1*2*3, etc.
Regardless, this was an interim step. What I need is two actions, the first FS easily allows, the second the complicating factor. 1) Enter either a numeric string (either a defined length or undefined length followed by a "#") 2) Enter an asterisk at anytime to allow reentry from the beginning (returning without requiring a following terminator)
I tried to use the callback and filter the input myself but since (I think) the callback only functions while the recording is playing that could not be done unless I was sure either the user responded during the recording or the recording was paused. Is there anyway for the the callback to delay and not return at the end of the recording?
Bob
2009/3/30 Anthony Minessale <anthony.minessale@gmail.com>:
how about leave the regex blank if you can't figure one out and just collect 6 digits and look for * yourself? The one I told you saturday works for what you asked about. the one
you
came back and asked about would require a | (or) with 2 expressions.
On Mon, Mar 30, 2009 at 7:20 AM, Robert Clayton <rjcajax@gmail.com> wrote:
Well, I hope that this thread has not died as it seems there has been no solution. Also, it seems there is not a solid understanding as to the interaction between Lua and FS.
Does this suggest that I should abandon Lua for another scripting implementation such as JavaScript?
2009/3/28 Anthony Minessale <anthony.minessale@gmail.com>:
try
/^([\d*]{6})$/
\d is shorthand for 0-9 and anything in a [] is a set of chars so [\d*] means 0-9 and * [\d*]{6} means exactly 6 from the previous set and wrap the whole thing in ^$ means exact match from beginning to end of the string.
2009/3/28 Robert Clayton <rjcajax@gmail.com> > > Michael, > > Good start! We are getting warmer. > > Where "(\\*|\\d{6})" will not match either * or 123456 or anything
I
> can > think of. > "\\*|\\d{6}" does match * and 123456 and does not match 1234 > So far so good. > BUT, if an asterisk(s) are entered in a combination with numbers > anything > goes **, *123, 123 *, 12*24, 12**34, 1*2*3, etc. > > Bob > > > On Fri, Mar 27, 2009 at 5:54 PM, Michael Collins > <msc@freeswitch.org> > wrote: >> >> 2009/3/27 Robert Clayton <rjcajax@gmail.com>: >> > Michael, >> > >> > Also note the error message reprints the expression without the >> > escape. >> > >> > Bob >> > >> > On Fri, Mar 27, 2009 at 2:29 PM, Michael Collins >> > <msc@freeswitch.org> >> > wrote: >> >> That just hit me. Try "\\*" instead of "\*" to see if maybe the >> backslash is getting dropped off between Lua and FreeSWITCH. >> >> -MC >> >> _______________________________________________ >> Freeswitch-dev mailing list >> Freeswitch-dev@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@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev > > UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-dev > http://www.freeswitch.org >
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com<MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org<sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com<MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org<sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Sorry the last line in my last email used a forward slash rather than a backslash. It should read: The escape characters seem to disappear and FS attempts to use the, \* an asterisk character, as * a metecharacter. On Fri, Mar 27, 2009 at 2:02 PM, Michael Collins <msc@freeswitch.org> wrote:
2009/3/27 Robert Clayton <rjcajax@gmail.com>:
As I understand it everything entered in square brackets(a character class) is literal. In parentheses it is read as a metacharacter.
Character classes have their own rules. I don't recommend using them unless you know precisely what you are doing. I like Brian's regex of "(\*|\d{6})"
In brackets you have interesting things, like dashes not always being dashes and a leading caret meaning negation.
[^A-Z] <== what does this mean? ;)
In any case, check the regular expressions page on the wiki for more online resources. -MC
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.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@freeswitch.org -- Meet us a ClueCon! http://www.cluecon.com
Brian, Thanks for the rapid reply. I was wanting, in Lua, for example to allow a user to enter either a file number or an asterisk to abort the function and return to an earlier option. I originally attempted this with a callback but found that at the end of the recording the callback would return, yet found no way to delay the return short of returning a pause on the first user input. This failed if the user waits until the recording has ended as the function returns. I assumed that stop might keep the callback active but it seems stop, break and false appear equivalent. So I attempted to apply session:playAndGetDigits which seems to only evaluate input on either, the maximum number of entries defined, or entry of a defined terminator. Where the entry of a terminator might be acceptable for the numeric entry the need for a terminator after an asterisk would seem clumsy. It would be great if after each digit the entry was matched against a regex, and if valid returned the value, with no need to predefine the terminator or minimum and maximum dtmf signals as everything could be defined in the regex. Regardless I seem to be unable to even define the regex to match a single asterisk as \* and [*] seem to be interpreted different than I would expect. This reminds me of the usual debit card check prompt "enter you sixteen digit number and press pound when finished". If the system knows there are only sixteen digits why require the pound. Compounding the required terminator, the need to evaluate for either an asterisk or a numeric string excapes me. Bob In short 2009/3/27 Brian West <brian@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@freeswitch.org
-- Meet us a ClueCon! http://www.cluecon.com
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
in short? You basically repeated the exact same thing in the previous email! (\*|\d{4}) * or any 4 digit number you can change that if you like. /b On Mar 27, 2009, at 10:03 AM, Robert Clayton wrote:
In short
Brian West brian@freeswitch.org -- Meet us a ClueCon! http://www.cluecon.com
Brian, Tried that as below. agent_id = session:playAndGetDigits(1, 3, 2, 10000,'#', 'c:/DictationProject/audio/Validating.wav', '', '(\*|\d{4})'); errors with: 2009-03-27 13:43:51 [ERR] switch_regex.c:184 switch_regex_match_partial() Regular Expression Error expression[(*|d{4})] error[nothing to repeat] location[1] Note the escape characters are not represented in the error message. Which if stripped by FS would create the error message "nothing to repeat". Sorry if the two emails were "basically" the same. I was not sure how to make my point more clear. So I attempted to be more succinct. Bob On Fri, Mar 27, 2009 at 11:10 AM, Brian West <brian@freeswitch.org> wrote:
in short? You basically repeated the exact same thing in the previous email!
(\*|\d{4})
* or any 4 digit number you can change that if you like.
/b
On Mar 27, 2009, at 10:03 AM, Robert Clayton wrote:
In short
Brian West brian@freeswitch.org
-- Meet us a ClueCon! http://www.cluecon.com
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Brian, 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? Bob 2009/3/27 Brian West <brian@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@freeswitch.org
-- Meet us a ClueCon! http://www.cluecon.com
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
(\*|\d{6}) Here are my recommendations for reference: http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/059652... This one is good too: http://www.amazon.com/Regular-Expression-Pocket-Reference-Expressions/dp/059... Even better: http://www.amazon.com/Regular-Expressions-Cookbook-Jan-Goyvaerts/dp/05965206... /b On Mar 27, 2009, at 10:09 AM, Robert Clayton wrote:
"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?
Brian West brian@freeswitch.org -- Meet us a ClueCon! http://www.cluecon.com
participants (5)
-
Anthony Minessale
-
Brian West
-
Even André Fiskvik
-
Michael Collins
-
Robert Clayton