Glad you got it working! It’s not immediately clear to me why the end of string anchor would be required on the subst_exp nor why it’s absence would cause the errors you were seeing. A bit strange.
Ben Newlin From: Users <[email protected]> on behalf of morris edery <[email protected]> Date: Thursday, June 6, 2024 at 12:52 AM To: OpenSIPS users mailling list <[email protected]> Subject: Re: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments ________________________________ Hello Ben, here is what works for me. dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+)$ repl_exp = \1 $ sign did the trick. Thanks so much for the support. On Wed, Jun 5, 2024 at 10:04 AM Ben Newlin <[email protected]<mailto:[email protected]>> wrote: There’s a few issues. 1. You are missing a “.” in your match_exp. The way you have it written will only match repeating digit 5 after the prefix. 2. Your subst_exp is too greedy. The wildcards in the first grouping will make that grouping match the whole string, and there will be nothing left for the second grouping (or it won’t match at all because of the + in the second grouping, not sure). If you are trying to match a fixed-string prefix you don’t need wildcards for that. You also don’t need to capture that grouping, since you aren’t using it in the replace. Try this: dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+) repl_exp = \1 Ben Newlin From: Users <[email protected]<mailto:[email protected]>> on behalf of morris edery <[email protected]<mailto:[email protected]>> Date: Wednesday, June 5, 2024 at 12:48 AM To: OpenSIPS users mailling list <[email protected]<mailto:[email protected]>> Subject: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments ________________________________ Hello Team, im trying to strip a prefix with dialplan from a number and from some reason have no success on that , please tell me what im doing wrong ? below opensips 2.4.8 dpid = 17 pr = 0 match_op = 1 match_exp = ^770555+ match_flags = 0 subst_exp = ^(*770555*)(.+) repl_exp = \2 need to remove 770555 on cfg file if (dp_translate("17", "$rU/$rU")){ } Thanks _______________________________________________ Users mailing list [email protected]<mailto:[email protected]> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
