On 5/18/2010 10:40 AM, J. Cliff Dyer wrote:
Don't use regular expressions for that.

s = '0x340x5A0x9B0xBA'
return '0x' + ''.join(s.split('0x'))

or
>>> '0x'+s[2:].replace('0x','')
'0x345A9BBA'

Take your pick, you should learn and understand both.

On Tue, 2010-05-18 at 06:48 -0700, Back9 wrote:
Hi,

I have a string like this:
0x340x5A0x9B0xBA
I want to extract 0x from the string but the first one.

How I can use re for this case?

The string size will vary.

TIA





--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to