ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Using Regex in AE

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Matthias Backmann
Using Regex in AE
on Dec 13, 2018 at 11:47:12 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?


Return to posts index

Matthias Backmann
Re: Using Regex in AE
on Dec 13, 2018 at 12:16:32 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]