#python - Sun 18 Feb 2007 between 20:31 and 08:02

NY Lost Funds



sproingiei think you need to learn basic regexes before you start fiddling with zero-width asserts
koshgreetings weirdos!
Pepersproingie: 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"
JerubPeper: what are you /actually/ trying to do.
Peperexactly what I have stated
sproingiei doubt your input data consists of "bar", "blah", and "test"
JerubPeper: well, no, you're showing a poor example that shows us what you think you want.
sproingiei doubt you're working for the NSA, so do leak a few details
PeperI want to sub "bar" with "test" only if the line is not starting with "foo" and "bar" is not followed by "blah"
JerubPeper: 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.
Peperbut I am looking for a single regex
JerubPeper: 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.
ayazavu: nope. i can't think of another way to do it except to put it between the multi-line comment characters.
avuayaz: 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
ayazavu: you know, the """ characters.
KirkMcDonald:.,$s/^/#/
avuthanks guys
Ind[y]avu: """this is a multiline
string"""
avuayaz: that's just a string
and I have many of those in the code.. :)
ayazavu: how about '''?
KirkMcDonald(That's a multi-line comment.) :-)
tkpI'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)
ayazhow are you doing it in the actual application?
tkp(it's not my app)
actually... take that back
it's doing sys.exit(1)
ayazok. so you have 'application-a' which exits with sys.exit(1). you call it from another application of yours?
tkpkinda
it's actually running from within another python app...

Page: 3 10 17 24 31 38 

IrcArchive

NY Lost Funds