[SR-Users] Case insensitive regexp in textops::search() function

Andrey Deykunov deykunov at gmail.com
Wed Jan 31 12:42:35 CET 2018


Hi,

I have an htable containing some black list words (i.e. user IDs or phone
models). To find matches of the words in every message I use the following
script:

sht_iterator_start("i1", "black_list");
while(sht_iterator_next("i1")) {
   if ( search($shtitval(i1)) ) {
      // do something
   }
}
sht_iterator_end("i1");

How can I modify search($shtitval(i1)) to get case insensitive matching?

The example below does not work:

sht_iterator_start("i1", "black_list");
while(sht_iterator_next("i1")) {
   $var(re) = $shtitval(i1) + "/i";
   if ( search($var(re)) ) {
      // do something
   }
}
sht_iterator_end("i1");

Other possible modifications of $var(re) aren't working too.

Thanks,
Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180131/3042c1a6/attachment.html>


More information about the sr-users mailing list