<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>adding some more details to mention that regex operations done by
      the core (the =~ operator) use the libc posix regex functions,
      which do not support extended syntax. Also, these operations done
      by core use the case insensitive flag.</p>
    <p>As mentioned by Henning, regex should be an alternative, or maybe
      dialplan if one wants db-storage+caching of those regex rules.</p>
    <p>Moreover, if the above are not enough, a kemi embedded
      interpreter (e.g., app_lua, app_python) can be used with inline
      execution in kamailio.cfg routing blocks -- those external
      scripting languages should have many options for regex matching.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 13.10.20 13:04, Henning Westerholt
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:AM0PR05MB6595962C9DB3F4D84C448ADAC5040@AM0PR05MB6595.eurprd05.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hello,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB">just an idea, have you already tried this
            module:
            <a
              href="https://www.kamailio.org/docs/modules/stable/modules/regex.html"
              moz-do-not-send="true">https://www.kamailio.org/docs/modules/stable/modules/regex.html</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB">Cheers,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB">Henning<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB">-- <o:p>
            </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB">Henning Westerholt –
          </span><span style="mso-fareast-language:EN-US"><a
              href="https://skalatan.de/blog/" moz-do-not-send="true"><span
                style="color:#0563C1" lang="EN-GB">https://skalatan.de/blog/</span></a></span><span
            style="mso-fareast-language:EN-US" lang="EN-GB"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB">Kamailio services –
          </span><span style="mso-fareast-language:EN-US"><a
              href="https://gilawa.com/" moz-do-not-send="true"><span
                style="color:#0563C1" lang="EN-GB">https://gilawa.com</span></a></span><span
            style="mso-fareast-language:EN-US">
            <span lang="EN-GB"><o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <div style="border:none;border-top:solid #E1E1E1
          1.0pt;padding:3.0pt 0cm 0cm 0cm">
          <p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b>
            sr-users <a class="moz-txt-link-rfc2396E" href="mailto:sr-users-bounces@lists.kamailio.org"><sr-users-bounces@lists.kamailio.org></a>
            <b>On Behalf Of </b>Marat Gareev<br>
            <b>Sent:</b> Tuesday, October 13, 2020 10:55 AM<br>
            <b>To:</b> Kamailio (SER) - Users Mailing List
            <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a><br>
            <b>Subject:</b> [SR-Users] Caseless regex<o:p></o:p></p>
        </div>
        <p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal" style="margin-left:35.4pt">Hello,<o:p></o:p></p>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt">Is it
              possible write more readable regular expression<o:p></o:p></p>
          </div>
          <div>
            <div>
              <div>
                <p class="MsoNormal"
                  style="margin-left:35.4pt;line-height:14.25pt"><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:blue">if</span><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:black"> ($tU =~
                  </span><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:#A31515">"(?i)^test$"</span><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:black">) {<o:p></o:p></span></p>
              </div>
              <div>
                <p class="MsoNormal"
                  style="margin-left:35.4pt;line-height:14.25pt"><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:black">    ...<o:p></o:p></span></p>
              </div>
              <div>
                <p class="MsoNormal"
                  style="margin-left:35.4pt;line-height:14.25pt"><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:black">}<o:p></o:p></span></p>
              </div>
              <div>
                <p class="MsoNormal"
                  style="margin-left:35.4pt;line-height:14.25pt"><span
                    style="font-family:"Arial",sans-serif;color:black">instead
                    of</span><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:black">
                  </span><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:#A31515">"^[tT][eE][sS][tT]$"</span><span
                    style="font-size:10.5pt;font-family:"Courier
                    New";color:black">?</span><span
                    style="color:black"><o:p></o:p></span></p>
              </div>
            </div>
          </div>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt">On the first
              option, I get the error:<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt">0(47250)
              ERROR: <core> [core/rvalue.c:3038]: fix_match_rve():
              Bad regular expression<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt">Regards,<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal" style="margin-left:35.4pt">Marat<o:p></o:p></p>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>