Flynn555
July 28th, 2009, 10:13 PM
hey i had a quick question about regular expressions in python
this is probably rather "noobie" but regex is not one of my strong points.
say i want to grab all the lines from an input file that do not begin with the character C
i know the expression to grab the lines that do begin with C is
^C.*
but i cant figure out how to just grab the lines that donot begin with C. is there any sort of negation in regex?
ex. !(^C).* <-- didnt work :(
any ideas?
this is probably rather "noobie" but regex is not one of my strong points.
say i want to grab all the lines from an input file that do not begin with the character C
i know the expression to grab the lines that do begin with C is
^C.*
but i cant figure out how to just grab the lines that donot begin with C. is there any sort of negation in regex?
ex. !(^C).* <-- didnt work :(
any ideas?