Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using Regex in AE

  • Posted by Matthias Backmann on December 13, 2018 at 11:47 am

    Heiho,

    I’m just trying to get a glimpse of RegEx in working with AE. But I can bring my idea to run in the tool. Perhaps, you can help me:
    I would like to find out the Version in different files (project-names or rendered files). So I can’t just use a split-method, esp. when our renderings also have a version-folder.
    Our naming would be s.th. like:
    Project-File:
    xxx_xxx_mograph.v001.aep
    Renderings:
    \xxx_xxx\output\v001\jpg\xxx_xxx_mograph_output.v001.[####].jpg

    my script looks like this (right now, I want to replace the version with a hardcoded “vxxx” – just to see if it works):

    var fileName = app.project.file;
    var p = ("(v+[0-9])");
    var versMatch = p.match(fileName);
    while (versMatch.find())
    fileName.replace(versMatch.group(1), "vxxx")
    alert ("New Filename:\n"fileName)

    What am I missing?

    Matthias Backmann replied 7 years, 8 months ago 1 Member · 1 Reply
  • 1 Reply
  • Matthias Backmann

    December 13, 2018 at 12:16 pm

    Sorry, the Code was messed up:
    var fileName = app.project.file;
    var p = ("(v+[0-9])");
    var versMatch = p.match(fileName);
    while (versMatch.find())
    {
    fileName.replace(versMatch.group(1), "vxxx");
    }
    alert ("New Filename:\n"+ fileName);

    That’s how far I got it

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy