Hello, all. I am using a regular _expression_ XXX_re = re.compile( ' \ d { 12 } ' ) # spaces
added for clarity that returns the value below from a string similar to this
one: XX(00000000) XXXXXXXXX[("XXX_XXX=123456789000","XXXXXX_XXX=1","Xxxxxxx=ABCDE01","Xxxxxxxxxxxx=ABCDEF","XxxxXxxxx=987654321000")] 123456789000 987654321000 I only want “ONE” occurrence, the first one in
the RE. The string pieces are 12 digits. I have tried prefacing the pattern with the ‘ XXX_XXX =
’ string segment, then I get XXX_XXX = 123456789000 When I use non-greedy ? or ., I get errors such as
unscriptable, or other. Any suggestions??? I am able to do this as two separate progs, but have been
unsuccessful at getting it all together as a one-pass code. Thanks! William |
-- http://mail.python.org/mailman/listinfo/python-list