Regex problem, extract data, help

hi, sorry for my bad English,
currently, I extracting dialogue from an old game(350MB)
after some time I succeed decode: how string data is saved,
for example



because it is hard to distinguish between dialogue data and raw data, I put the mark like this:


the result is like this:


then i remove the “][” and add a new line after “]” and before “[”,
so it became like this:

[This Data]		    //<=data
БбВвГгДдЕеЁёЖжЗз]	//<=junk because do not start with [
ИиЙйКкЛлМмНнОоПп	//<=junk because do not start with [, and end with ]
[РрСсТтУуФфХхЦцЧч	//<=junk because do not end with ]
[This data too]		//<=data

as you can see, I have 3 kinds of junk(lines 2,3 and 4),
at this point I like to know, is there any regex to remove that junk lines?,
please help!!

Sounds a little bit like a XY problem to me. :wink:

How about to share the raw input, the expected output and what you have tried so far? There might be a better way of getting the results you want including avoiding to get the junk just you showed. :wink:

thanks for reply, i will not upload it, i afraid i get banned,
it a PS1/PSX Game called “harvest moon : back to nature” with ID: SLUS_01115,

and this link how i get the data :Google Translate

just for info, i just need the dialogue text,
thanks again for the reply

Something like this?

PS E:\Temp> Select-String -Path E:\Temp\Files\dialog.txt -Pattern '^\[.+\]$' | Select-Object -ExpandProperty Line
[This Data]
[This data too]
1 Like

sorry for the late reply, I just come home and the raw data is 350MB so it takes time, combines with I do not add “Set-Content”, so I run it twice

thank you a lot, your code is working, thank you again