Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: regular expression

by Anonymous Monk
on Feb 15, 2012 at 12:44 UTC ( [id://953935]=note: print w/replies, xml ) Need Help??


in reply to Re: regular expression
in thread regular expression

I have to show only fist 6 and last 4 digits in between there can be any number of characters

Replies are listed 'Best First'.
Re^3: regular expression
by moritz (Cardinal) on Feb 15, 2012 at 12:56 UTC

      Slight variation so you don't need the length:

      substr($str, 6, -4) =~ s/./X/g;

      Inspiring. Subtracting the sum of the value of the length of the first and last visible digits to establish the variable length of the middle section. ++

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://953935]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-23 17:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found