MRAB wrote: > I'd probably do: > >>>> p = re.compile(r'#\s*include\s+(?:<([^>]*)>|"([^"]*)")') >>>> m = p.search('#include <header.h>') >>>> m.group(1) or m.group(2) > 'header.h' > yes, it's easier to understand. thanks, MRAB! I always make things complicated :P tiefeng wu 2009-07-23