Re: regex replace credit card numbers with *
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 29 Sep 2005 11:11:52 -0700
Tad McClellan wrote:
> >> "cldmismgr" <admin@xxxxxxxxxx> wrote in news:1128001319.174650.190970
> >> @g47g2000cwa.googlegroups.com:
> >>
> >> > replace all but the last 4 numbers
> >> > in a credit card number with *'s.
>
> an lvalue substr():
>
> substr($cc, 0, -4) =~ tr/0-9/*/;
Ooh, I like! I was trying to think of a good way of doing this with
substr, but I was blanking on remembering the "negative limit" feature
of the function.
Thanks, Tad.
Paul Lalli
.
- References:
- regex replace credit card numbers with *
- From: cldmismgr
- Re: regex replace credit card numbers with *
- From: A. Sinan Unur
- Re: regex replace credit card numbers with *
- From: Tad McClellan
- regex replace credit card numbers with *
- Prev by Date: Re: protect calling files directly?
- Next by Date: Re: string matching specific number of times
- Previous by thread: Re: regex replace credit card numbers with *
- Next by thread: Re: regex replace credit card numbers with *
- Index(es):
Relevant Pages
|