in reply to Not getting proper output value

Your posted code has some problems:

A general point: Don't you see that you are trying to process two basically different patterns? 'int abc;' gets altered (apparently) unconditionally, but '.abc(abc_p)' gets altered only if the 'abc' or 'abc_p' pattern is repeated. Recognizing the patterns you're dealing with is the first step toward solving this (or any) regex problem.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^2: Not getting proper output value
by suvendra123 (Initiate) on Apr 05, 2021 at 22:59 UTC
    Perl v5.24.2 , I am running
      Perl v5.24.2 ...

      Ok, thank you. This version gives you the very useful regex Extended Patterns of version 5.10 and the nice-to-have /r modifier for s/// substitution (update: of version 5.14).


      Give a man a fish:  <%-{-{-{-<

A reply falls below the community's threshold of quality. You may see it by logging in.