in reply to another string replacement with uppercase :: converting C macros to C++
Hello f77coder,
Your first try is close, but has two problems:
#! perl use strict; use warnings; while (<DATA>) { s/__(\S+?)__/uc($1)/eg; print; } __DATA__ #ifdef __some_Long_name__ do stuff #endif
Output:
18:25 >perl 1523_SoPW.pl #ifdef SOME_LONG_NAME do stuff #endif 18:27 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: another string replacement with uppercase :: converting C macros to C++
by martin (Friar) on Jan 23, 2016 at 09:06 UTC | |
by Athanasius (Cardinal) on Jan 23, 2016 at 09:21 UTC | |
|
Re^2: another string replacement with uppercase :: converting C macros to C++
by choroba (Cardinal) on Jan 23, 2016 at 09:18 UTC | |
|
Re^2: another string replacement with uppercase :: converting C macros to C++
by f77coder (Beadle) on Jan 23, 2016 at 08:36 UTC |