Im using python 2.7.4
I have a list of strings. It has a bunch of stuff in it. Most importantly it has this line in it:
Just an Fyi, if I look at that same line in hex edit though, i get this:
Anyway, I can match part of that string, like this:
Code:
tdstrings = tdstrings.replace('\xc2\xa0-','HELLO')
produces:
HELLO _U
Just as it should.
But this is where i am confused. I add 3 more characters to that statement up there and it doesnt work. Ive used escapes, spaces, unescaped,.. everything i can think of, but basically this example here does not work:
Code:
tdstrings = tdstrings.replace('\xc2\xa0- _U','HELLO')
or
tdstrings = tdstrings.replace('\xc2\xa0- \_U','HELLO')
or
tdstrings = tdstrings.replace('\xc2\xa0-\ \_U','HELLO')
or
tdstrings = tdstrings.replace(' -\ \_U','HELLO')
or
tdstrings = tdstrings.replace('\ -\ \_U','HELLO')
produces:
- _U
as if none of those match at all. Even though i can match the first part. Someone have a moment to explain this to me?