I have a file of the form
00040 void FormExample::setLanguage(const std::string lang)
00041 {
00042 bool haveLang = false;
00043
I want to remove the numbers from the file so that it can compile.
I tried using
sed -e ‘s/^(\d)*//g’ test.cpp but was not successful. Please tell me what was I doing wrong.
It can be any other standard unix tool besides sed. Shell script, python script, awk etc will also be considered.
Thanks
This works:
sed‘s regex flavor is a bit different than Perl’s. You don’t have this “shorthand” character classes ( e.g.\dor\w) and grouping is done by\( \). The parenthesis in your expression match literally.