Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Minimizing the amount of place holders on long identical regex

by haukex (Archbishop)
on Jun 20, 2018 at 17:06 UTC ( [id://1217026]=note: print w/replies, xml ) Need Help??


in reply to Minimizing the amount of place holders on long identical regex

But in my case this is not possible as the system that I am writing the regex does not support the split function or join it only supports C format commands syntax, so I am using Perl as a test tool before implementation.

Does the system you're on (which one - PCRE?) support search and replace?

my $sample = "041424344454647484940414"; (my $output = $sample) =~ s/.\K.//g; # alternative s/(.)./$1/g; die $output unless $output eq "012345678901";
  • Comment on Re: Minimizing the amount of place holders on long identical regex
  • Download Code

Replies are listed 'Best First'.
Re^2: Minimizing the amount of place holders on long identical regex
by thanos1983 (Parson) on Jun 20, 2018 at 17:19 UTC

    Hello haukex,

    Awesome thanks a lot that worked perfectly.

    BR / Thanos

    Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-24 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found