Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by thanos1983 (Parson)
on Jun 20, 2018 at 16:22 UTC ( [id://1217016]=note: print w/replies, xml ) Need Help??


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

Hello tybalt89,

Thank you for your time and effort. The solution is working but in my case I can not using array as an output or join to put the array in a string. This is why I am using place holders. Is there any way to use only odd place holders to store the characters?

Thanks again for your time and effort.

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

Replies are listed 'Best First'.
Re^3: Minimizing the amount of place holders on long identical regex
by jimpudar (Pilgrim) on Jun 20, 2018 at 16:40 UTC

    This is starting to sound like an XY problem.

    Can you give a little more context on why you "can not using array as an output or join to put the array in a string"?

    We might be able to help you overcome this with this additional information.

    Best,

    Jim

    πάντων χρημάτων μέτρον έστιν άνθρωπος.

      Hello jimpudar,

      Thank you for your time and effort reading my question. I have wrote it on my question:

      I could use potentially split the string character by character and store the output in an array. Where from there I would remove the even elements and reform the array into string with join. 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.

      The environment that I want to apply the regex is written in C language and only follows C syntax solutions, but since Perl is also written in C language any solution in Perl works also for the system. So I am using Perl as test bed to find a more elegant solution than mine.

      I hope now it is more clear. :)

      BR / Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!
        char *even_chars(const char *src) { char *dst = malloc(strlen(src)/2 + 1); char *p = dst; while (1) { if (!*src) break; *(p++) = *(src++); if (!*src) break; src++; } *p = 0; return dst; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217016]
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-19 02:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found