NoSleepCreative Wiki
  • Welcome to NoSleepCreative
  • After Effects
    • Getting Started with Expressions
    • Expressions & Snippets
      • JSX Cheatsheet
      • Expression Troubleshooting
      • Utilities
      • Shape & Mask
      • Type & Text
    • Cookbook
      • Algorithmic
      • Random properties
      • Harmonic Motion
      • Staggering
      • Tessellation & Tiling
      • Type animators
      • Speed lines
      • Radial Array
      • Orb & Trails
      • Shading & Texturing
      • Responsive
      • Automation
      • Setup & Rigs
    • Getting started with Scripting
    • Scripting
      • Utilities
      • Master Properties
    • ScriptUI
  • Studio Ops
    • Tooling
    • Toolkitting
    • Knowledge Base
    • Naming Convention
    • DAM
  • Cinema 4D
    • Formulas
    • Python Cheat Sheet
      • For Artists
      • Maya Environment
      • Maya snippets
      • VSFX 705
    • Cookbook
  • Info
    • About
    • Portfolio
    • Course
    • YouTube
    • Gumroad
    • GitHub
  • Dev
    • archive
      • Webscraping
      • Google Sheets Formulas
      • SQL
      • Terminal
      • C++
      • Unreal Engine
      • Concert Visualization
      • Dome-projection
      • UI UX
      • Professional Etiquettes
      • Woes
      • How to get better
        • Portfolio / Showreel
        • Design with cooking
      • Media theories
        • Post Cinematic Affect
        • Marxism, Reproduction and Aura
        • Heuristics & Authorship
        • 02 Semiotics
        • 3 Process?
        • 05
        • 06 Technology & Mediation
        • Formalism
        • Simulation
        • The Gaze & Media Critique
        • Import
        • 10-12
      • Recommended books
        • 🔴Things I learned
      • Mac Superuser
        • Applescript
      • InDesign
      • Illustrator
      • Blender
      • Premiere Pro
      • Mathematics
        • Probability
        • Linear Algebra
      • Shader Dev
      • Getting Started with After Effects
        • Best Practices
        • Pimping up AE
        • Environment
      • Houdini
        • Cheatsheet
        • Cookbook
        • Techniques
        • Dynamic
        • Rendering & Lighting
        • Animation
        • Particles
        • Others
          • Modeling
          • Fluids - Pyro & Smoke
          • Rendering
      • REGEX
    • Sandbox
      • Nexrender
        • Terminology
        • Project Files Preparation
Powered by GitBook
On this page
  • Recommended Readings
  • What is regular expression?
  • Why it matters?
  • The basics
  • Character class
  • Cookbook
  • HEX codes
  • NCAA

Was this helpful?

  1. Dev
  2. archive

REGEX

PreviousRenderingNextSandbox

Last updated 1 year ago

Was this helpful?

Recommended Readings

Item

Links

Documentation / Tutorials

Cheatsheet

Books

Tester

What is regular expression?

A regular expression is a sequence of that define a search . Usually such patterns are used by for "find" or "find and replace" operations on , or for input validation. It is a technique developed in and theory. — Wikipedia It works similar to when we are searching something on Google but in a more advanced and specific way.

Why it matters?

  • Remove human errors when it come to countless of data sorting or wrangling

  • Save you time and effort - once you written it once, it's reuable

The basics

Character class

[]

Cookbook

//1st word including hyphen eg.Bethune-Cookman
^\w+\b[-]{0,1}(\w+)?


1st 2 words with/without "'s" 
^\w+\s\w+[\']?s?

//2 words only
^\w+\s\w+$ 

// searching ???
.+\(.+\)

// Last word in parenthesis
\(([^)]*)\)[^(]*$

HEX codes

[A-Fa-f0-9]{6} // single 


// HEX codes from "Primary: 0050A3 Secondary: FFFFFF" 
 \s[a-zA-Z0-9]{6,} 

NCAA

// team names 
(\w*Alt\w*){0,1}((-\s)?\w*ALT\w*){0,1}","")

// breaking 
^\w+[-]?\w // catch hyphenated compound
^\w+\b[-]{0,1}[\w+]? // break two words 
^\w+[']?\w?\s\w+[\']?s?" // break words with apostrophe 

\w+\s\w+$ // capture last 2 words 
\w+$ // capture last word 

// optimized 
^[\w's&-.]+[ &]?[\w's&.]+


// workflow 
// 1. break school with State 
^[\w's&-.]+[ &]?[\w's&.]+ [State]+
^[\w's&-.]+[ &]?[\w's&.]+ [StateUniversity]+

characters
pattern
string searching algorithms
strings
theoretical computer science
formal language
https://regexone.com/
https://www.rexegg.com/
https://www.regular-expressions.info/lookaround.html
https://dev.to/catherinecodes/a-regex-cheatsheet-for-all-those-regex-haters-and-lovers--2cj1
https://regex101.com/
https://regexr.com/
My Dataset