[asterisk-users] pattern containing an asterisk

C. Chad Wallace cwallace at lodgingcompany.com
Wed May 12 18:16:59 CDT 2010


At 8:04 PM on 12 May 2010, Robert Wagner wrote:

> i need to match a number with like 03012345678*0 or 03012345*9
> I tried _X.*X and _X!*X but both are maching 03012345678 too, ignoring
> that *X is required at the end.
> The interesting part is that like expected _X*X is matching only
> numbers like 1*1 and not 11

The . in a pattern is meant only to be used at the end, to match any
remaining characters.  The *X after the dot in your pattern is just
being ignored.  Have you checked for warnings in your log?  I'm not
sure if Asterisk issues a warning on that, but I think it should.

One thing you could do is make one pattern for each possible length.
e.g.: _XXXXXXXXXXX*X and _XXXXXXXX*X

If you need it to be variable length, I think you would need to use the
Read application instead of standard dialplan matching.


-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20100512/111a50af/attachment.pgp 


More information about the asterisk-users mailing list