That works great! :D. Thanks man, that problem has been bugging me for
awhile now.
--~--~-~--~~~---~--~~
http://groups.google.com/group/python_inside_maya
-~--~~~~--~~--~--~---
Sorry if I get something completely wrong here but why don't you do this?:
arr = [u'Bricks_|_BRICKS_1', u'_BRICKS_2', u'_BRICKS_3', u'_BRICKS_4',
u'Bricks_|Small_BRICKS_1']
arrNew = []
for a in arr:
arrNew.append(a.split("Bricks_|")[-1])
print arrNew
"""
gives [u'_BRICKS_1', u'_BRICKS_2', u'
Hey again! I was wondering if you could perhaps throw some of that
tokenizing help again my way. I'm having trouble getting the right
selection to be able instance in objects. My problem is this, i have
several objects parented to a group. Now my problem is that the list
of the children comes out
Thanks! That was a great help : )
--~--~-~--~~~---~--~~
http://groups.google.com/group/python_inside_maya
-~--~~~~--~~--~--~---
>>> import re
>>> reg = re.compile( "([^.]+)\.\w+\[(\d+)\]$" )
>>> reg.match( 'parent|foo_barSpangle1.f[22]' ).groups()
('parent|foo_barSpangle1', '22')
>>> reg.match( 'cubeThing.vtx[0]' ).groups()
('cubeThing', '0')
so to break it down:
([^.]+) one or more of anything that's not a period.