Skip to content
On this page

Regex

Regex Primer is great read.

I use regex101 every time I want write a new regex.

Pomsky is nice too.

Regular Expression Matching Can Be Simple And Fast & Regular Expression Matching: the Virtual Machine Approach are nice reads.

Notes

  • .* = will select all occurrences
  • A regex is useful for validating simple patterns and for finding patterns in text. For anything beyond that it’s almost certainly a terrible choice.

Code

Match if it has notes or twitter in input^(?=.*(?:notes|twitter)).*

Match all that don't have notes or twitter in input ^(?!._(?:notes|twitter))._