Press C-uC-s to begin a regexp search
Note that to insert the
^J you wont actually type ^J. ^J is the representation of a newline character, you insert this hard new line by typing C-qC-j
So you are searching for:
anything not a comma,
followed by a comma,
followed by anything to the end of the line,
followed by a new line,
followed by the first matched thing.
You could turn it into a command like so:
(defun find-next-matching-prefix-lines ()
"Move forward to the next pair of lines that match up to the first comma on each line."
(if (re-search-forward "^\\(.*?,\\).*\n\\1" (point-max) t 1)
(message "no more matches found!")))