Skip to content

Instantly share code, notes, and snippets.

@crutchcorn
Created November 15, 2019 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crutchcorn/cc97dd4c33944d88302214c9b986f48f to your computer and use it in GitHub Desktop.
Save crutchcorn/cc97dd4c33944d88302214c9b986f48f to your computer and use it in GitHub Desktop.

Optional Chaining

\b([.a-zA-Z]+)\s+?&&\s+?\1\.

This should find instances such as:

test && test.thing

And

test.data && test.data.other

But not:

test && test

test && other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment