<div dir="ltr">Thank you all that works just fine, my last step is to create an if statement to only enter to do this if the condition matches.<div><br></div><div><div><br></div><div>if($rU=~"XYZ") //where xyz is anything not 0-9 * and #</div>
<div>{ </div><div><br></div><div>$rU = $(rU{re.subst,/[^0-9*#]//g});</div><div><br></div>}</div><div><br></div><div>Regards</div><div><br></div><div><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 10:42 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@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 bgcolor="#FFFFFF" text="#000000">
Hello,<div class="im"><br>
<br>
<div>On 2/12/13 9:28 AM, Ali Jawad wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi
<div>Thanks, what I actually need is keep numbers and * and #
and remove the rest, something like </div>
<div><br>
</div>
<div>
<div> $rU = $(rU{re.subst,/![0-9*#]//g});</div>
<div><br>
</div>
<div>
But I am not sure that ! works for negation.</div>
</div>
</div>
</blockquote></div>
use [^0-9*#] for negation, see:<br>
<br>
- <a href="http://www.regular-expressions.info/charclass.html" target="_blank">http://www.regular-expressions.info/charclass.html</a><br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite"><div class="im">
<div dir="ltr">
<div>
<div><br>
Regards</div>
<br>
<div class="gmail_quote">On Mon, Feb 11, 2013 at 5:43 PM,
Daniel Tryba <span dir="ltr"><<a href="mailto:daniel@pocos.nl" target="_blank">daniel@pocos.nl</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Monday 11 February 2013 11:24:36 Ali
Jawad wrote:<br>
> I am using the below to strip "-" from destination
numbers, it does work<br>
> just fine "I replace - with nothing", what i need
to do now is to strip all<br>
> characters except 0-9 * and #. Is there anyway to
do it using the following<br>
> configuration part<br>
<br>
</div>
You are using regular expression substitution, so yes this
can be done:<br>
/[^0-9*#]//g<br>
<br>
Take a look at <a href="http://en.wikipedia.org/wiki/Regular_expression" target="_blank">http://en.wikipedia.org/wiki/Regular_expression</a><br>
for more info.<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
<div dir="ltr">
<div>
<div><font><font color="#888888"><b><br>
</b></font></font></div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<pre cols="72">--
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
- <a href="http://conference.kamailio.com" target="_blank">http://conference.kamailio.com</a> -</pre>
</font></span></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br><div dir="ltr"><div><div><font><font color="#888888"><b><br></b></font></font><div><div></div></div></div></div></div>
</div></div>