I want to capture the strings from the following:
// want "Closed", "RequireApplication", "Open"
export type RegistrationMode = "Closed" | "RequireApplication" | "Open";
// want "All", "Comments", ..., "Url"
export type SearchType =
| "All"
| "Comments"
| "Posts"
| "Communities"
| "Users"
| "Url";
However, the matcher I wrote export type \w+ =(\S+)?(?:\s+\| (\S+))*;
only matches the last group and misses the ones in the middle.
https://regex101.com/r/SBpaVY/1
What am I missing?