Skip to content

Instantly share code, notes, and snippets.

@animoplex
Created September 5, 2018 00:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save animoplex/b9f600110ed151faf213361eeea323c3 to your computer and use it in GitHub Desktop.
Save animoplex/b9f600110ed151faf213361eeea323c3 to your computer and use it in GitHub Desktop.
Regular Expressions - After Effects Expression by Animoplex
// Regular Expressions - Created by Animoplex: www.animoplex.com
// Complex methods of searching and replacing text dynamically.
// Full Tutorial: https://www.youtube.com/watch?v=oz352OsNgnI
// Check out http://regexr.com/
// RegEx Examples
text.sourceText.replace(/one/gi,"1").replace(/two/gi,"2") // Replace "one" with "1" and "two" with "2"
text.sourceText.replace(/-/gi,"#") // Replace "-" with "#"
// Note: The /gi flags instruct the engine to search globally for text (g) and to be case insensitive (i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment