Hi Matti,

I'm not exactly sure what you are trying to accomplish, but I would
like to point out that `split()` has an optional parameter `maxsplit`
that limits the number of splits that are actually done.  Shouldn't
that help to solve your problem?

In [11]: s='host.sub1.sub2.example.com'                                         

In [12]: s.split('.', 2)                                                        
Out[12]: ['host', 'sub1', 'sub2.example.com']

In [13]: s.split('.', 3)                                                        
Out[13]: ['host', 'sub1', 'sub2', 'example.com']

You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to