I wanna parse namespaces in c# cs file, for example using System.Collections.Generic I want to capture groups (System) (Collections) (Generic).
So far i wrote this regular expression: "[ .]?(\w*?)(?=[.;])"
but it also marks every words which suits this pattern.

So I have to add condition that line begins with "using".
I tried to add this "using[ .]?(\w*?)(?=[.;])" but it will only capture first namespace.
There is input text
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Text.RegularExpressions;
string someString;
Console.ReadLine();
Update:
I'm sorry I didn't mentioned it first, but there is one more thing, the same thing will happen with Methods, for example, Console.ReadLine() shouldnt return ReadLine. The same for all dots that are not in using

using, then another for getting the subnamespaces.