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

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

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

  • Comment on Re^3: Minimizing the amount of place holders on long identical regex

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

    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; }