Re: Changing entities

2005-06-10 Thread Kent Johnson
Daniel wrote: > Hi Kent > > This isn't work with the following line: > FieldGraphic56::= GraphicString EBCDIC BC= " " SIZE (56 > BYTES) > > byter = re.compile(r'SIZE \((\d+) BYTE\)') Because the string doesn't match the pattern, can you see the difference? Do you understand what

Re: Changing entities

2005-06-10 Thread Daniel
Hi Kent This isn't work with the following line: FieldGraphic56::= GraphicString EBCDIC BC= " " SIZE (56 BYTES) >>> byter = re.compile(r'SIZE \((\d+) BYTE\)') >>> s = 'SIZE (1 BYTE)' >>> byter.sub(r'SIZE(\1)', s) 'SIZE(1)' >>> byter.sub(r'SIZE(\1)', line) 'FieldGraphic56::= Gr

Re: Changing entities

2005-06-10 Thread Daniel
Hi Kent This isn't work with the following line: FieldGraphic56::= GraphicString EBCDIC BC= " " SIZE (56 BYTES) >>> byter = re.compile(r'SIZE \((\d+) BYTE\)') >>> s = 'SIZE (1 BYTE)' >>> byter.sub(r'SIZE(\1)', s) 'SIZE(1)' >>> byter.sub(r'SIZE(\1)', line) 'FieldGraphic56::= Gr

Re: Changing entities

2005-06-09 Thread Kent Johnson
Daniel wrote: > I need match a regular expression, change it erasing the other strings > after this. Just like: > > a = "I'm going send to out of space, find another race" > > And I want to match "space" instance, and erase the other. If you mean you want to get rid of everything after 'space',

Re: Changing entities

2005-06-09 Thread Daniel
Hi Kent Thanks for your help, it worked sucessfully. I have another question, I think it is a stupid and simple but... I need match a regular expression, change it erasing the other strings after this. Just like: a = "I'm going send to out of space, find another race" And I want to match "space

Re: Changing entities

2005-06-08 Thread Kent Johnson
Daniel wrote: > Hello all > > I need to build a program that check the sintax in a line: > > SIZE (1 BYTE) > > and change the correct number of bytes to the following format: > > SIZE(1) > > without the "BYTE" word. But, the number of bytes can be over 3 digits, > and the entitie can't have sp

Changing entities

2005-06-08 Thread Daniel
Hello all I need to build a program that check the sintax in a line: SIZE (1 BYTE) and change the correct number of bytes to the following format: SIZE(1) without the "BYTE" word. But, the number of bytes can be over 3 digits, and the entitie can't have spaces but the correct number of bytes i