Search code examples
jrepl

How to use the /M option in JREPL.BAT to get strings across multiple lines?


I want to get all strings between <LANG ID="en-GB"> and </LANG> that spands across multiple lines. The amount of lines between is not always the same. Can anyone help?

<LANG ID="en-GB">Throttle up and take to the skies in this radar-evading advanced strategic bomber.\n
\n
Designed for flying into the heart of the battle zone undetected, this stealth aircraft contains top-secret avionics that no one can know about!\n

\n

This locomotion object will boost your speed:\n
・Standard = 5.25m/s [#Legal]</LANG>

What I have currently: CALL JREPL ">(.*)</" "$txt=$1" /I /XSEQ /JMATCHQ /M /S LINE_1 /A /RTN LINE_2


Solution

  • figured it out.

    CALL JREPL "<LANG ID=\q.*\q>([\s\S]*?)</LANG>" "$txt=$1" /M /JMATCHQ /I /XSEQ /S DESC /RTN DESC