[SR-Users] Strip All but numbers/*/#

Daniel-Constantin Mierla miconda at gmail.com
Tue Feb 12 09:42:11 CET 2013


Hello,

On 2/12/13 9:28 AM, Ali Jawad wrote:
> Hi
> Thanks, what I actually need is keep numbers and * and # and remove 
> the rest, something like
>
>                 $rU = $(rU{re.subst,/![0-9*#]//g});
>
> But I am not sure that ! works for negation.
use [^0-9*#] for negation, see:

- http://www.regular-expressions.info/charclass.html

Cheers,
Daniel

>
> Regards
>
> On Mon, Feb 11, 2013 at 5:43 PM, Daniel Tryba <daniel at pocos.nl 
> <mailto:daniel at pocos.nl>> wrote:
>
>     On Monday 11 February 2013 11:24:36 Ali Jawad wrote:
>     > I am using the below to strip "-" from destination numbers, it
>     does work
>     > just fine "I replace - with nothing", what i need to do now is
>     to strip all
>     > characters except 0-9 * and #. Is there anyway to do it using
>     the following
>     > configuration part
>
>     You are using regular expression substitution, so yes this can be
>     done:
>     /[^0-9*#]//g
>
>     Take a look at http://en.wikipedia.org/wiki/Regular_expression
>     for more info.
>
>
>
>
> *
> *
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
  - http://conference.kamailio.com -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130212/3cabf5b7/attachment.htm>


More information about the sr-users mailing list