-
Conditional RegEx
Not sure if this was covered before (can’t seem to find it online).
I’m trying to have a mogrt warn the user if the year entered in a text layer is valid or not.
I have another text layer with the warning written and I want to have its opacity be triggered if the year is not valid.
I wrote a condition and AE doesn’t give me an error but it doesn’t seem to work.
var txt = thisComp.layer("YEAR").text.sourceText;
var newReg = ("/^\d{4}$/g");
txt == newReg ? 0 : 100;
The opacity stays at 100%.
I don’t know if I should be using match() here or not.
Any clues?
Thanks!