[Freeswitch-users] matching word
Michael Collins
msc at freeswitch.org
Thu May 26 22:49:48 MSD 2011
Your regex is only going to match a single alphanumeric character. Are you
trying to match an actual email address or what? Once you know what you hope
to match it will be easier to know which regex to use. For the record a
semi-proper email grabbing regex is like this:
^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})$
Matching emails is an interesting exercise. If you're not all into "making
it perfect" and just want to capture "foo at bar" then do something like this:
^([^@]+ at .*)$
-MC
On Thu, May 26, 2011 at 10:02 AM, Sam <u2nsam at gmail.com> wrote:
> Thanks for that,
>
> I want to use that when someone with username sam at gmail.com will be routed
> to a voicemail dialplan, with domain partitioning.
>
> here still i am not able to achiveve it with domain.
>
> <domain name="gmail.com">
>
> <extension name="public_extensions">
> <condition field="destination_number" expression="^(\w)$">
> <action application="info"/>
> <action application="voicemail" data="default $${domain_name} $1"/>
> </condition>
> </extension>
>
> </domain>
>
> here above gmail.com is examplary .
>
> when there is an invite coming from different server to FS with
> sam at gmail.com and it is routed directly on voicemail context to route via
> public.xml
>
> here first the call is not recognized to the context gmail.com but when i
> remove that it goes to voicemail directly properly and stores the voicemail.
>
> but the voicemail is not stored under domain name gmail.com which should
> store it ideally under domain name as folder, which it is just storing it
> under user sam folder.
>
> This is what I want to achieve.
>
> Regards
> Sam
>
>
>
>
>
> On Thu, May 26, 2011 at 3:56 PM, mazilo <Nabble at slickdeals.endjunk.com>wrote:
>
>>
>> samir wrote:
>> >
>> > Friends,
>> >
>> > How can i match words in expressions,
>> >
>> > is it by expression="^(\y\w+\y)$" or could be something else.
>> >
>> > Regards
>> > Sam
>> I understand ^(\w)$ will match any word, but not with \y. Perhaps, if you
>> tell us exactly what you want to accomplish, someone will chime in for a
>> better solution.
>>
>> -----
>> FreeSWITCH hosted on a Seagate DockStar with OpenWRT and ONLY consumes 3
>> Watts of electricity.
>> --
>> View this message in context:
>> http://freeswitch-users.2379917.n2.nabble.com/matching-word-tp6406170p6406420.html
>> Sent from the freeswitch-users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110526/829210f6/attachment.html
More information about the FreeSWITCH-users
mailing list