<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Hi,</div><div class=""><br class=""></div><div class="">The replacement should be \1 not \2.</div><div class="">At least in my tests on <a href="https://regexr.com" class="">https://regexr.com</a> with \2 the result is 9729 and with \1 its 972123456789</div><div class=""><br class=""></div><div class=""><div class="">Matching Regular Expression - ^0[0-9]{8}$<br class=""></div><div class="">Substitution Regular Expression: ^(0)([0-9]{8})$<br class=""></div><div class="">Replacement Expression: <span style="background-color: rgb(255, 252, 64);" class="">972\1</span></div></div><div class=""><br class=""></div>Tomi<br class=""><div><br class=""><div class="">On 22. Jan 2020, at 20.50, Sharad Kumar via Users <<a href="mailto:users@lists.opensips.org" class="">users@lists.opensips.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hey guys,<br class=""></div><div class=""><br class=""></div><div class="">I need your little help in regex, I have a regex that search the 9 Digits DID and append 972 as a prefix. So for example -<br class=""></div><div class=""><br class=""></div><div class="">DID - 012345678<br class=""></div><div class="">After regex - 9720123456789<br class=""></div><div class=""><br class=""></div><div class="">But now I want to remove the first 0 by regex so that I should get the output like this - 97212345678<br class=""></div><div class=""><br class=""></div><div class="">These are my current regex rules -<br class=""></div><div class="">Matching Regular Expression - ^0[0-9]{8}$<br class=""></div><div class="">Substitution Regular Expression: ^(0)([0-9]{8})$<br class=""></div><div class="">Replacement Expression: 972\2<br class=""></div><div class=""><br class=""></div><div class="">Any help or suggestions will be appreciated. <br class=""></div><div class="">Thank you <br class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="protonmail_signature_block protonmail_signature_block-empty"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br class=""></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br class=""></div></div><div class=""><br class=""></div>_______________________________________________<br class="">Users mailing list<br class=""><a href="mailto:Users@lists.opensips.org" class="">Users@lists.opensips.org</a><br class="">http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br class=""></div></div><br class=""></body></html>