[OpenSIPS-Users] Regex module limitations ?

denis.barbaron at orange.com denis.barbaron at orange.com
Mon Oct 1 12:25:02 CEST 2012


I would like to use the "regex" module to perform pattern matching against strings or SIP headers in order to get back results in the same way I can do it with PCRE API, as follow : preg_match_all('#<([ib])>(.*?)</\1>#', $txt, $out). The problem is that "regex" module seems to not be able to provide such feature but only a comparison function returning a boolean value (TRUE or FALSE), as follow :
if (pcre_match("$ua", "(?i)^twinkle")) {
    xlog("L_INFO", "User-Agent matches\n");

The only way I found to solve this problem would be to use the "exec" module to run an external script doing the job or to develop a new module, so is there a more simple solution please ?

[cid:image001.gif at 01CD85FD.DD28EF80]

Denis Barbaron
R&D engineer
tél. +33 2 96 05 03 57
denis.barbaron at orange.com<mailto:thierry.moreau at orange-ftgroup.com>


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
France Telecom - Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, France Telecom - Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121001/ea07926c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1286 bytes
Desc: image001.gif
URL: <http://lists.opensips.org/pipermail/users/attachments/20121001/ea07926c/attachment.gif>

More information about the Users mailing list