Re: String splitting with exceptions

2013-08-29 Thread wxjmfauth
Le mercredi 28 août 2013 18:44:53 UTC+2, John Levine a écrit : > I have a crufty old DNS provisioning system that I'm rewriting and I > > hope improving in python. (It's based on tinydns if you know what > > that is.) > > > > The record formats are, in the worst case, like this: > > > > fo

Re: String splitting with exceptions

2013-08-28 Thread John Levine
>Can you have brackets within brackets? If so, this is impossible to deal >with within a regex. Nope. It's a regular language, not a CFL. >Otherwise: re.findall('((?:[^[:]|\[[^]]*\])*):?',s) >['foo.[DOM]', '', '[IP6::4361:6368:6574]', '600', '', ''] That seems to do it, thanks. -- Regard

Re: String splitting with exceptions

2013-08-28 Thread Peter Otten
Neil Cerutti wrote: > On 2013-08-28, John Levine wrote: >> I have a crufty old DNS provisioning system that I'm rewriting and I >> hope improving in python. (It's based on tinydns if you know what >> that is.) >> >> The record formats are, in the worst case, like this: >> >> foo.[DOM]::[IP6::436

Re: String splitting with exceptions

2013-08-28 Thread Neil Cerutti
On 2013-08-28, Tim Chase wrote: > On 2013-08-28 13:14, [email protected] wrote: >> On Wed, Aug 28, 2013, at 12:44, John Levine wrote: >> > I have a crufty old DNS provisioning system that I'm rewriting >> > and I hope improving in python. (It's based on tinydns if you >> > know what that is.)

Re: String splitting with exceptions

2013-08-28 Thread Neil Cerutti
On 2013-08-28, John Levine wrote: > I have a crufty old DNS provisioning system that I'm rewriting and I > hope improving in python. (It's based on tinydns if you know what > that is.) > > The record formats are, in the worst case, like this: > > foo.[DOM]::[IP6::4361:6368:6574]:600:: > > What I

Re: String splitting with exceptions

2013-08-28 Thread Tim Chase
On 2013-08-28 13:14, [email protected] wrote: > On Wed, Aug 28, 2013, at 12:44, John Levine wrote: > > I have a crufty old DNS provisioning system that I'm rewriting > > and I hope improving in python. (It's based on tinydns if you > > know what that is.) > > > > The record formats are, in th

Re: String splitting with exceptions

2013-08-28 Thread random832
On Wed, Aug 28, 2013, at 12:44, John Levine wrote: > I have a crufty old DNS provisioning system that I'm rewriting and I > hope improving in python. (It's based on tinydns if you know what > that is.) > > The record formats are, in the worst case, like this: > > foo.[DOM]::[IP6::4361:6368:6574]

Re: String splitting with exceptions

2013-08-28 Thread Skip Montanaro
> The record formats are, in the worst case, like this: > > foo.[DOM]::[IP6::4361:6368:6574]:600:: > Any suggestions? Write a little parser that can handle the record format? Skip -- http://mail.python.org/mailman/listinfo/python-list