Re: How to prevent re.split() from removing part of string

2009-12-01 Thread Jeremy
On Nov 30, 5:24 pm, MRAB pyt...@mrabarnett.plus.com wrote: Jeremy wrote: I am using re.split to... well, split a string into sections.  I want to split when, following a new line, there are 4 or fewer spaces.  The pattern I use is:         sections = re.split('\n\s{,4}[^\s]', lineoftext)

How to prevent re.split() from removing part of string

2009-11-30 Thread Jeremy
I am using re.split to... well, split a string into sections. I want to split when, following a new line, there are 4 or fewer spaces. The pattern I use is: sections = re.split('\n\s{,4}[^\s]', lineoftext) This splits appropriately but I lose the character matched by [^s]. I know I

Re: How to prevent re.split() from removing part of string

2009-11-30 Thread MRAB
Jeremy wrote: I am using re.split to... well, split a string into sections. I want to split when, following a new line, there are 4 or fewer spaces. The pattern I use is: sections = re.split('\n\s{,4}[^\s]', lineoftext) This splits appropriately but I lose the character matched by

Removing part of string

2007-05-14 Thread saif . shakeel
Hi, I am parsing an xml file ,and one part of structure looks something like this: - COMPARAM id=_338 DDORef=_18 Semantics=timing PhysicalLink=Infotainment_Control_Bus_CAN SHORTNAMEInfotainment_Control_Bus_CAN_TIMEOUT_AX/SHORTNAME LONGNAMETimeout N_As/N_Ar/LONGNAME DESCRIPTIONTime from

Re: Removing part of string

2007-05-14 Thread Michael Bentley
On May 14, 2007, at 12:56 AM, [EMAIL PROTECTED] wrote: Hi, I am parsing an xml file ,and one part of structure looks something like this: - COMPARAM id=_338 DDORef=_18 Semantics=timing PhysicalLink=Infotainment_Control_Bus_CAN

Re: Removing part of string

2007-05-14 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], saif.shakeel wrote: Hi, I am parsing an xml file ,and one part of structure looks something like this: - COMPARAM id=_338 DDORef=_18 Semantics=timing PhysicalLink=Infotainment_Control_Bus_CAN SHORTNAMEInfotainment_Control_Bus_CAN_TIMEOUT_AX/SHORTNAME

Re: Removing part of string

2007-05-14 Thread half . italian
On May 13, 10:56 pm, [EMAIL PROTECTED] wrote: Hi, I am parsing an xml file ,and one part of structure looks something like this: - COMPARAM id=_338 DDORef=_18 Semantics=timing PhysicalLink=Infotainment_Control_Bus_CAN SHORTNAMEInfotainment_Control_Bus_CAN_TIMEOUT_AX/SHORTNAME

Re: Removing part of string

2007-05-14 Thread saif . shakeel
On May 14, 1:04 pm, [EMAIL PROTECTED] wrote: On May 13, 10:56 pm, [EMAIL PROTECTED] wrote: Hi, I am parsing an xml file ,and one part of structure looks something like this: - COMPARAM id=_338 DDORef=_18 Semantics=timing PhysicalLink=Infotainment_Control_Bus_CAN