Skip to content

Instantly share code, notes, and snippets.

@T99
Created August 25, 2021 20:26
Show Gist options
  • Select an option

  • Save T99/4dd4e9864253d0a6dae2a7f3cee132f1 to your computer and use it in GitHub Desktop.

Select an option

Save T99/4dd4e9864253d0a6dae2a7f3cee132f1 to your computer and use it in GitHub Desktop.
TypeScript Class Signature Regexp
^\s*(?:(?<export>export)\s+)?(?<typeType>class|abstract\s+class|interface)\s+(?:(?<typeName>[a-zA-Z][a-zA-Z0-9]*)(?<typeGenerics><.*?>)?)\s+(?:extends\s+(?<extends>[a-zA-Z][a-zA-Z0-9]*(?:<.*?>)?)\s+)?(?:implements\s+(?<implements>[a-zA-Z][a-zA-Z0-9]*(?:<.*?>)?(?:,\s+[a-zA-Z][a-zA-Z0-9]*(?:<.*?>)?)*)\s+)?{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment