How js fetches a specific array from a file

I store a lot of parameters in a file, all separated by newline (n).
for example:
a muri 1
a muri 2
bMel 1
Cmuri 1
bMel 2
a muri 3
I can take out and save as an array.
let arr = content.split (/ [s] n [s] /)
how can you take only specific arrays, such as taking out only those that start with an or b and saving them as arrays.
like:

Mar.11,2021

can be implemented using the string method, first using \ n to split, and then filter out a and b . The
string has a startsWith method

let tag = 'a'

require('fs').readFileSync('XXX').split('\n').filter(line => line.startsWith(tag))
Menu