I'm not really sure what you are looking for, but with \obeylines in place within the environment, a token cycle can be used to search for the line ends and emplace (as in your example) a :: between lines.
\documentclass{article}
\usepackage{tokcycle}
{\obeylines
\gdef\mycr{
}}
\def\myenvname{linebyline}
\newenvironment{\myenvname}{\obeylines\catcode`\%=12 \tokencycle
{\addcytoks{##1}}
{\processtoks{##1}}
{%
\expandafter\ifx\mycr##1\addcytoks{::}\else
\ifx\end##1
\tcpop\z\tcpushgroup\z%
\ifx\z\myenvname
\tcpush{\noexpand\endtokcycraw##1}%
\else\addcytoks{##1}\fi
\else\addcytoks{##1}\fi
\fi}
{\addcytoks{##1}}}{}
\begin{document}
\begin{linebyline}
% Comment
Line 1
Line 2
% Comment
Line 3
\end{linebyline}
Back to
normal
text.
\begin{linebyline}
% Comment
Line 1 \today
Line 2\begin{itemize} \item xxx\end{itemize}
% Comment
Line 3
\end{linebyline}
Back to % absolutely
normal
text.
\end{document}

If one desires the parsed content to not be executed, but instead detokenized, and the line content of each line collected, one can do this:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tokcycle}
{\obeylines
\gdef\mycr{
}}
\def\myenvname{linebyline}
\newenvironment{\myenvname}{\obeylines\catcode`\%=12 \tokencycle
{\addcytoks{\string##1}}
{\addcytoks{\{}\processtoks{##1}\addcytoks{\}}}
{%
\expandafter\ifx\mycr##1
\mbox{}\\Input line: ``\the\cytoks''% <-CURRENT INPUT LINE
\cytoks{}%
\else
\ifx\end##1
\tcpop\z\tcpushgroup\z%
\ifx\z\myenvname
\tcpush{\noexpand\endtokcycraw##1}%
\else\addcytoks{\detokenize{##1}}\fi
\else\addcytoks{\detokenize{##1}}\fi
\fi}
{\addcytoks{##1}}}{}
\begin{document}
\begin{linebyline}
% Comment
Line 1
Line 2
% Comment
Line 3
\end{linebyline}
Back to
normal
text.
\begin{linebyline}
% Comment
Line 1 \today
Line 2\begin{itemize} \item xxx\end{itemize}
% Comment
Line 3
\end{linebyline}
Back to % absolutely
normal
text.
\end{document}

\\\for line breaks. – projetmbc Dec 17 '23 at 22:47\obeylinesor set\endlinecharor ... – David Carlisle Dec 17 '23 at 22:56regexfor this. Splitting at a single character can be done with\seq_set_split:Nnnor\seq_set_split_keep_spaces:Nnn. – Skillmon Dec 18 '23 at 08:45regexif it's just about splitting lines, and I wanted to make sure you realise this.l3regexis brilliant code, don't get me wrong, but it is used "in the wild" way too often for things simpler tools can do just as well yet hundreds of times faster. – Skillmon Dec 18 '23 at 13:23