Hi All,
I am attempting to write a macro to delete end-of-line comments containing
preceding code using a regular expression.
eg:
// This is the constructor of a class that has been exported. NOT TO BE
DELETED
// see dll_three.h for the class definition NOT TO
BE DELETED
//
Cdll_three::Cdll_three()
{
std::cout << "In // " __FUNCTION__ << std::endl;// jjj - TO BE DELETED
}// example - TO BE DELETED
Cdll_three::~Cdll_three()/// example - TO BE DELETED
{
std::cout << "In " __FUNCTION__ << std::endl; // /*TO BE DELETED*/
}/* TO BE DELETED*/
As my skill in regular expressions is seemingly insuffient to master this
problem can anyone help or point me to an another source of help.
Thanks
SamP
Mirko Matytschak - 07 Jun 2006 14:17 GMT
[^\s]+(//.*)
gives you in Match.Groups[1] the string to be deleted.
Mirko
> Hi All,
>
[quoted text clipped - 22 lines]
> Thanks
> SamP