Don't use regular expressions for that. s = '0x340x5A0x9B0xBA' return '0x' + ''.join(s.split('0x')) 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 >