I have a very large file containing about, for example, 5 million lines like this:
Songs=****, Singers=****
Singers=***
Songs=***
.... # many many lines
SongType=***
... # many many lines again
Album=***, Singers=**
Since all characters replaced by *
are Chinese characters I use /[a-zA-Z]*=
to match "Songs", "Singers". And I don't know if I've matched the third: "SongType" since I cannot see it using my eyes, let alone the fourth: "Album".
The problem is that: can I use a vague pattern, in my case [a-zA-Z]*=
to know all distinct possibilities(of the same pattern)? I mean all the four strings here.
Of course I can use g
command to delete all that matched and see those left. But what if the fifth and others are so rare that I cannot pick them out in the left lines? And in this way the "Album" is deleted and I can never find it.
I have tried to first copy all matched strings to a register and then sort u
it in an other file to check, but failed because of the register limitation.
The problem is that the file is too large and contains may not only these three type and I want to check all the matched distinctions.
I'm not really sure I understand the question. Do you want to search for different strings in the same pattern as nobe4 showed you or are you trying to do something else?[a-zA-Z]*=
right? I think your idea of putting it all in a register was good what was your limitation?