Hi,
here is the whole example:
import re
import nuke
fileKnob = nuke.selectedNode().knob('file').value()
reMatch = re.search('(#+)|(%\d\d?d)', fileKnob)
if reMatch:
print reMatch.group(0)
Hope that gets you started.
Best
Sebastian
Am 11.11.2011 um 15:16 schrieb Sebastian Kral:
> Hi,
>
> here is a pattern "(#+)|(%\d\d?d)". Just did a quick test but should do the
> work.
>
> Best
>
> Sebastian
>
> Am 11.11.2011 um 10:53 schrieb Fredrik Averpil:
>
>> Hi,
>>
>> How would you guys go about searching for the frame numbering #### or %04d
>> inside a filename?
>>
>> I'd like to be able to search for the numbering in filenames with any number
>> of periods in the filename;
>> - this.is.the.name.of.the.script.####.exr
>> - this.is.frame.no.####.of.the.script.exr
>> - ####.exr
>> ...etc
>>
>> Regular expressions?
>>
>>
>> // Fredrik
>>
>> _______________________________________________
>> Nuke-python mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
--
Sebastian Kral
mobile +49 176 23462356
Wiesenweg 10
63303 Dreieich
Germany
[email protected] - http://sebastiankral.de
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python