__DATA__
/*This is the file which is used for the
developing the code for multiple IO operation
Author : Hello Wolrd remove */
void main();
/*Hello World */
/* hello
world
good
morning
comment /*
/* Hello Good Morning
!!!!!!!!!!!!!!!!!*/
void main()
{
printf("Hello World");
}
The above code is my c file. Here I have to replace "Hello" by "Hi".. if I do simple parse the file and replace ... it will replace in all the places, For both comment and non-comment part of the code. But I have to replace it only in non-comment part. Is it possible to replace ?
After I reading and rewriting the same file I should have the following output
__DATA__
/*This is the file which is used for the
developing the code for multiple IO operation
Author : Hello Wolrd remove */
/*Hello World */
/* hello
world
good
morning
comment /*
/* Hello Good Morning
!!!!!!!!!!!!!!!!!*/
void main()
{
printf("Hi World");
}
How to decide the string is a comment or non-comment code for c files? Is it possible to do replace only non-comment part of the code?