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
>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
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
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.)
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
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
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]
> 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