Hey guys,
I am fairly new to regular expressions.
When I want to get the delimiter between a filename and framenumber I am
using the following regex.
f = myawesome_filename_v1_0001.exr"
pat = re.compile*('[\.|\_]\d+[\.]\w{3}')*
x = re.search(pat, f)
print x.group()
delimiter = x.group()[0]
print 'delimiter : ' + delimiter
This works specifically for the case where you might have filename.####.ext
or filename_####.ext.
Question is ... is this a decent/efficient way to do this ?
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/91317257-669e-49ae-8394-b26f4ea1b441%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.