Regular Expressions Problem

Oriana oriana.falco at thalesesec.com
Thu Sep 9 14:48:17 EDT 2004


Hi!

  I'm trying to 'clean up' this source file using regular expressions
in Python. My problem is, that when I try to delete extra lines, my
code fails. Here's an example....

/**
*
* Project:      MyProject
*
*
*
*
*
*
*
* Description:
*
*    This file contains the some code.
*
* Public Functions:
*
*     function_1
*     function_2
*
* Private Functions:
*
*    None.
*
*
* Notes:
*
*    None.
*
*
*
*************************************************************************/


.....I would like my code to only have one * space between lines, and
not all that white space that I see there. I tried to use the regular
expression: '^\*\n$^\*\n$' but that does not work. I've tried a bunch
of things and none of them seem to work....please help!!! Thanks in
advance, Oriana



More information about the Python-list mailing list