2 Replies Latest reply on May 21, 2015 9:28 AM by caststupider

    Layer Name to TextArray

    caststupider Level 1

      Hello i need help,


      I have a TextLayer named "YourName:Example".

      Now i would that the Text after "YourName:" is the shown text.


      I tried some expressions but it always give me a number back..


      Hope Someone can help me

      Thanks and have a good day

        • 1. Re: Layer Name to TextArray
          A. Cobb Level 3

          Set the Source Text expression to:



          name.replace(/YourName:/, "")


          "/YourName:/" is a regular expression (don't confuse "regular expression" with the "expression" of AE parlance, these are different things).  The replace() function looks for a match for the text between the / characters, and returns a string that has that text replaced with the second argument, which is the empty string.  Regular expressions (RegExps for short) are very powerful tools for matching text, and are used by a lot of the String member functions like replace(), match(), split(), etc.  If you want to learn more, google "regular expression tutorial" and you'll find a wealth of information to get you started.

          • 2. Re: Layer Name to TextArray
            caststupider Level 1

            Thank you for the fast answer

            Have a nice day