Hi I want to delete a line using sed if it matches 2 regular expressions in the same line. EG the line starts with /* and end with */ (comment). The following script will do m
this strips out multiline comments as well
eg
# cat file blah blah /* comment */ words1 words2 /* multiline comments /* end $ awk -vRS='*/' '{ gsub(/\/\*.*/,""); }1' file blah blah words1 words2
you can add another filter to sed 's|\/\/.*||' to filter out // comments as well
sed 's|\/\/.*||'
//