Regular expression, "except end of string", question.
insert at spam.here
Thu Jun 17 04:17:11 CEST 2004
Derek Basch wrote:
>string = "WHITE/CLARET/PINK/XL"
>which I need to alter to this format:
>string = "WHITE-CLARET-PINK/XL"
You need the (?!...) operator: http://docs.python.org/lib/re-syntax.html
#replace "/" with "-" if not followed by a word at the end of the string
but like they said, join and split are better here instead of
using regular expressions.
More information about the Python-list