|sproingie||i think you need to learn basic regexes before you start fiddling with zero-width asserts|
|Peper||sproingie: I don't know what's basic|
>>> re.sub("bar(?!blah)","test","blah blah bar bar barblah")
'blah blah test test barblah'
I want that + omit lines starting with "foo"
|Jerub||Peper: what are you /actually/ trying to do.|
|Peper||exactly what I have stated|
|sproingie||i doubt your input data consists of "bar", "blah", and "test"|
|Jerub||Peper: well, no, you're showing a poor example that shows us what you think you want.|
|sproingie||i doubt you're working for the NSA, so do leak a few details|
|Peper||I want to sub "bar" with "test" only if the line is not starting with "foo" and "bar" is not followed by "blah"|
|Jerub||Peper: what are you actualyl trying to do, because chances are I can show you a nicer, simpler, way.|
okay! even with that I can help.
|Peper||but I am looking for a single regex|
|Jerub||Peper: okay, I'm not caring about what you're looking for.|
Peper: I'm only interested in the actual problem you're trying to solve.
which I'm still not clear on.
|ayaz||avu: nope. i can't think of another way to do it except to put it between the multi-line comment characters.|
|avu||ayaz: what multiline-comment characters? I only know of strings to use as such in python, which is a bit tricky since they are used in the code I want to comment out as well.|
ind[y]: I guess using some editor-magic to really comment those line is the best way to go, I agree
|ayaz||avu: you know, the """ characters.|
|Ind[y]||avu: """this is a multiline|
|avu||ayaz: that's just a string|
and I have many of those in the code.. :)
|ayaz||avu: how about '''?|
|KirkMcDonald||(That's a multi-line comment.) :-)|
|tkp||I'm running a python app which is exiting with sys.exit(2)|
but in the actull app, I always seem to get 0
exen tho I have looked at the code and can see wher it is dying... with exit(2)
|ayaz||how are you doing it in the actual application?|
|tkp||(it's not my app)|
actually... take that back
it's doing sys.exit(1)
|ayaz||ok. so you have 'application-a' which exits with sys.exit(1). you call it from another application of yours?|
it's actually running from within another python app...