Data
7. Masi is the same as
\begin{enumerate}
A
B
ABC ha lorem
\end{enumerate}
1. ABC is
\begin{enumerate}
P
B
Lorem maam
\end{enumerate}
which I want to be
7. Masi is the same as
\begin{enumerate}
\item A
\item B
\item ABC ha lorem
\end{enumerate}
1. ABC is
\begin{enumerate}
\item P
\item B
\item Lorem maam
\end{enumerate}
My startup regex is based on this answer
perl -000pe s/\n/\n\\begin{enumerate}\n [A-Za-z1-9]* \end{enumerate}/ ... [problem here!] masi.tex
where
- -000 : activate Perl's paragraph mode, this causes "lines" to be defined by two consecutive newlines (\n\n), so that each of your questions is treated as a single line.
- -pe : read each line of the input file and print it (-p) after applying the script passed as -e.
I want to replace the beginning of each new line inside the match with \item
.
My pseudocode for problem here code
s/\n/\item /g
to apply things inside enumerate environment.
How