<div dir="ltr"><div>Your first group is matching From: <sip:anonymous@[2008:abcd:<wbr>1234:2260:208:5dff:fe93:5b6 but it looks like you want it to only match  <sip:anonymous@. Try escaping the brackets, the regex engine is interpreting them as a list instead of matching the literal "[]" characters.</div><div><br></div><div>subst('/^From:(.*)\[2008:abcd:<wbr>1234:2260:208:5dff:fe93:5b65\](<wbr>.*)>(.*)/From:\1[2008:abcd:<wbr>1234:2260:20c:29ff:fe9a:b9cb]><wbr>\3/ig');<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><p> </p>


<table style="max-width:430px;border-spacing:0;border-collapse:collapse;table-layout:fixed" width="100%">
        <tbody>
                <tr>
                        <td>
                        <table style="border-spacing:0;border-collapse:collapse">
                                <tbody>
                                        <tr>
                                                <td style="padding:0 0 3px 0"><span style="font-family:Arial,sans-serif;font-weight:bold;font-size:24px;color:#2a9cd9">John Petrini</span></td>
                                        </tr>
                                        <tr>
                                                <td style="padding:0 0 14px 0"><span style="font-family:Arial,sans-serif;font-weight:normal;font-size:14px;color:#777777">Platforms Engineer</span></td>
                                        </tr>
                                </tbody>
                        </table>
                        </td>
                </tr>
                <tr>
                        <td>
                        <table style="border-spacing:0" width="100%">
                                <tbody>
                                        <tr>
                                                <td style="padding:0 6px 0 0;min-width:68px;line-height:1" width="68"><img border="0" src="https://i.xink.io/Images/Get/N63353/c386.jpg" style="width:100%;min-width:68px;max-width:70px;height:auto;display:block" width="68"></td>
                                                <td height="60" style="background-color:#ebebeb;padding:0 0 0 25px;max-height:60px;max-width:362px" width="83%">
                                                <table style="border-spacing:0;border-collapse:collapse">
                                                        <tbody>
                                                                <tr>
                                                                        <td style="padding:5px 0 0 0;line-height:1" width="100%">
                                                                        <div style="float:left;vertical-align:middle;width:151px">
                                                                        <table style="border-spacing:0;border:none;border-collapse:collapse" width="100%">
                                                                                <tbody>
                                                                                        <tr>
                                                                                                <td style="text-align:center" width="15"><img alt="Call CoreDial" border="0" height="15" src="https://cdn2.hubspot.net/hubfs/210539/email/si-email-signature/redesign/coredial-email-phone.png?noresize" style="width:100%;max-width:15px;display:block;border:0px" width="15"></td>
                                                                                                <td style="font-family:Arial,sans-serif;line-height:1;padding:0 0 0 5px"><span style="font-family:Arial,sans-serif;font-weight:normal;font-size:12px;color:#444444;white-space:nowrap"><a href="tel:215-297-4400" style="font-family:Arial,sans-serif;color:#444444;text-decoration:none" target="_blank">215.297.4400 x 232</a></span></td>
                                                                                        </tr>
                                                                                </tbody>
                                                                        </table>
                                                                        </div>
                                                                        

                                                                        <div style="float:left;vertical-align:middle;width:151px">
                                                                        <table style="border-spacing:0;border:none;border-collapse:collapse" width="100%">
                                                                                <tbody>
                                                                                        <tr>
                                                                                                <td style="text-align:center" width="15"><img alt="Call CoreDial" border="0" height="15" src="https://cdn2.hubspot.net/hubfs/210539/email/si-email-signature/redesign/coredial-email-website.png?noresize" style="width:100%;max-width:15px;display:block;border:0px" width="15"></td>
                                                                                                <td style="font-family:Arial,sans-serif;line-height:1;padding:0 0 0 5px"><span style="font-family:Arial,sans-serif;font-weight:normal;font-size:12px;color:#444444;white-space:nowrap"><a href="https://coredial.com/" style="font-family:Arial,sans-serif;color:#444444;text-decoration:none" target="_blank">www.coredial.com</a></span></td>
                                                                                        </tr>
                                                                                </tbody>
                                                                        </table>
                                                                        </div>
                                                                        </td>
                                                                </tr>
                                                        </tbody>
                                                </table>
                                                </td>
                                        </tr>
                                </tbody>
                        </table>
                        </td>
                </tr>
                <tr>
                        <td style="padding:13px 0 10px 0">
                        <table style="border-spacing:0;border-collapse:collapse">
                                <tbody>
                                        <tr>
                                                <td style="padding:0 20px 0 0"><img alt="CoreDial" border="0" src="https://cdn2.hubspot.net/hubfs/210539/email/si-email-signature/redesign/coredial-logo.gif?noresize" style="max-width:101px;display:block;border:0px" width="101"></td>
                                                <td style="line-height:1"><span style="font-family:Arial,sans-serif;font-weight:normal;font-size:11px;color:#777777"><a href="https://www.google.com/maps/place/CoreDial,+LLC/@40.140902,-75.2878857,17z/data=!3m1!4b1!4m5!3m4!1s0x89c6bc587f1cfd47:0x4c79d505f2ee580b!8m2!3d40.140902!4d-75.285697" style="font-family:Arial,sans-serif;font-weight:normal;font-size:11px;color:#777777;text-decoration:none" target="_blank"><span style="white-space:nowrap">751 Arbor Way,</span> <span style="white-space:nowrap">Hillcrest I, Suite 150</span> <span style="white-space:nowrap">Blue Bell, PA 19422</span></a></span></td>
                                        </tr>
                                </tbody>
                        </table>
                        </td>
                </tr>
                <tr>
                        <td>
                        <table style="border-spacing:0;border:none;border-collapse:collapse">
                                <tbody>
                                        <tr>
                                                <td style="font-family:Arial,sans-serif;font-size:9px;color:#aaaaaa;line-height:1.25"><span>The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.</span></td>
                                        </tr>
                                </tbody>
                        </table>
                        </td>
                </tr>
        </tbody>
</table>
</div></div>
<br><div class="gmail_quote">On Mon, Jul 2, 2018 at 9:40 AM, mahesh b <span dir="ltr"><<a href="mailto:mahesh.b.2487@gmail.com" target="_blank">mahesh.b.2487@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks John for the Reply.<div><br></div><div>So if i understand properly :</div><div>group 1 is here  <sip:anonymous@</div><div>group 2 is empty</div><div>group 3 is 

<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;tag=41008079_nab_FFFF_isp_</span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">FFF<wbr>F_cco_FFFF_igo_FFFF_mgt_</span><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">78DD</span>

</div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div>the previous expression is working for IPv4.</div><div><br></div><div><br></div><div>Now for IPv6</div><div><br></div><div><div>Input         :           From: <sip:anonymous@[2008:abcd:<wbr>1234:2260:208:5dff:fe93:5b65]><wbr>;tag=42006C96_nab_FFFF_isp_<wbr>FFFF_cco_FFFF_igo_FFFF_mgt_<wbr>8092</div><div>subst('/^From:(.*)[2008:abcd:<wbr>1234:2260:208:5dff:fe93:5b65](<wbr>.*)>(.*)/From:\1[2008:abcd:<wbr>1234:2260:20c:29ff:fe9a:b9cb]><wbr>\3/ig');</div><div>Output      :           From: <sip:anonymous@[2008:abcd:<wbr>1234:2260:208:5dff:fe93:5b6[<wbr>2008:abcd:1234:2260:20c:29ff:<wbr>fe9a:b9cb]>;tag=42006C96_nab_<wbr>FFFF_isp_FFFF_cco_FFFF_igo_<wbr>FFFF_mgt_8092    //what is going wrong here?</div></div><div><br></div><div>Here </div><div>group 1 is 

<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span><sip:anonymous@</span>

</div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">group 2 is empty</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">group 3 is 

<span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;tag=42006C96_nab_FFFF_isp_<wbr>FFFF_cco_FFFF_igo_FFFF_mgt_<wbr>8092</span>

</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">what mistake am i making for IPv6 ? if you see the output.</span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Regards,</span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Mahesh.b</span></span></div><div><br></div></div><br><div class="gmail_quote"><span class=""><div dir="ltr">On Mon, Jul 2, 2018 at 6:54 PM John Petrini <<a href="mailto:jpetrini@coredial.com" target="_blank">jpetrini@coredial.com</a>> wrote:<br></div></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><div dir="ltr"><div>They are references to groups in the regex match. The groups are in parenthesis. Whatever is matched by group 1 and 3 will be included in the substitution.</div><div><br></div><div><a href="https://regexr.com/" target="_blank">https://regexr.com/</a> and <a href="https://regex101.com/" target="_blank">https://regex101.com/</a> are both good sites for building and explaining regexes.<br></div></div></span>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
</blockquote></div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div>