Issue
I am using sed
to remove comment characters at the beginning using s/${pn_ere}//
. The delimiter ends up being a problem for C++ code when I have the line start being //
.
What alternative to /
could I use that would be safe to use for most programming languages?
sed -n "/$beg_re/,/$end_re/ {
/$beg_re/d ; /$end_re/z; s/${pn_ere}// ; p`
s/${pn_ere}//
but have to replace the use of /
and use another delimiter. In this way I can handle C++ code where comments start with //
.
Solution
You could use "_" for example.
See here for more ideas.
Answered By - GhostCat Answer Checked By - Willingham (WPSolving Volunteer)