Given that I recognize this as MIDI data, I assume you want to remove all midi data except for their notes, separated by a space.
You will want to use the following regex pattern for that:
([A-Z]#*.).+?;.+? (note the space at the end. I used ALT+255 because SuperUser removes it otherwise.)
And replace for:
\1 (also note the space at the end, also ALT+255 there.)
It will make all replacements except for the very last note, unless there's a space at the end too.
The regex explained:
( - Start Capture group
[A-Z] - Search for any char between A and Z, exactly 1 time
#* - Search for a # 0 or more times
. - Search for any character exactly 1 time.
) - End capture group
The above search will result in the midi note, eg A3 and store it in \1
.+? - Continue to search for any character 1 or more times in non-greedy way.
; - Search until we find the first ;
.+? - Search for any character 1 or more times in non-greedy way.
- search until we find a space.