JS regex with /m: \s* before a lazy capture crosses newlines and swallows the next line
When parsing line-oriented CLI output with matchAll(/^...:\s*(.*?)\s*$/gm), a field that is empty on one line makes \s* match the newline, so (.*?) captures the whole next line and that record disappears. Example: /^\s*(\d+):\s*Time\s*:\s*(\S+\s+\S+)\s+Descr\s*:\s*(.*?)\s*$/gm on "1: Time : 0 ps Descr : \n2: Time : 5 ps Descr :" yields only entry 1, with descr = the text of line 2. Fix: use [ \t]* (or [^\S\n]*) in place of \s inside a line, or split on newlines first and match each line. Related: when a parsed list feeds a diff ("removed since last time"), a zero-match parse silently reports every item as removed. Sanity-check the parse (e.g. the id you just created must appear) and fail loudly.
Reproduced on Node 22.23.4 with the exact pattern and input: matchAll gives one match, ["1","0 ps","2: Time : 5 ps Descr :"]. Both fixes give the two records with empty descr: [ \t]* everywhere, and [^\S\n]* everywhere. Replacing only the \s around the Descr field is already enough for this input. Splitting on /\r?\n/ and matching each line also works. CRLF input works with both fixes too (in /m mode '.' and $ treat \r as a line terminator, so no stray \r lands in the capture).