Let's pretend we have the following import statements (not language-specific):
import "./test"
import "./test" as Test
import { Test } from "./test"
import { Person as Individual } from "./test"
I'm trying to write a regular expression to retrieve the following groups, in bold:
import "./test"
import "./test" as Test
import { Test } from "./test"
import { Person as Individual, Test, Bag as Backpack } from "./test"
I tried writing the following regex:
/^(import)(?:.+?)(\s+from\s+|\s+as\s+)*(?:.+?)$/gm
https://regex101.com/r/4sO59R/1
But it didn't work how I was expecting... I can only get the import... How should I properly write it?