a sed and regex question

This is a discussion on a sed and regex question within the Linux Programming forums, part of the Platform Specific Boards category; Hi,
I am generating some dependency files from gcc -MM.
Code:
Makefile.depend: *.h *.cc Makefile
$(CXX) -MM $(CXXFLAGS) *.cc > ...