I get the pattern.
/(?<=<TOTA>[^]+\blength=")[^"]+(?="[^]+<\/TOTA>)/g
And test on regex101.com ,it can work in ECMAScript
mode.
Now I want to use pattern in Vscode search, how to convert the pattern??
Below is the examples of a file.
<TxDef encoding="EBCDIC" txAdapter="Unisys" appAdapter="pass" xmlTransformer="Unisys" transportAdapter="SystemF" targetTx="" txMapper="" delimiter="" memo="pp">
<TITA>
<TxBlock dataTag="" renderTag="Y" memo="" ref="SystemF-TITA-COM-AREA" />
<TxField id="BCURCD" cname="cc" datatype="9" lengthtype="F" padchar=" " justify="" default="" length="2" lengthExpr="" scale="0" tagSize="0" lengthSize="0" encoding="" shiftInOut="Y" invisibleChar="TrimAndPadRight" memo="" optional="N" overwrite="N" codec="" renderTag="" charFormat="" />
<TxField id="STATUS" cname="c6" datatype="9" lengthtype="F" padchar=" " justify="" default="" length="1" lengthExpr="" scale="0" tagSize="0" lengthSize="0" encoding="" shiftInOut="Y" invisibleChar="TrimAndPadRight" memo="" optional="N" overwrite="N" codec="" renderTag="" charFormat="" />
<TxField id="END" cname="gg" datatype="X" lengthtype="F" padchar=" " justify="" default="" length="1" lengthExpr="" scale="0" tagSize="0" lengthSize="0" encoding="" shiftInOut="Y" invisibleChar="TrimAndPadRight" memo="" optional="N" overwrite="N" codec="" renderTag="" charFormat="" />
</TxBody>
<TxTail dataTag="" renderTag="Y" memo="" ref="" />
</TITA>
<TOTA>
<TxHead dataTag="" renderTag="Y" memo="" ref="" />
<TxBody dataTag="CommMsg" renderTag="Y" memo="" ref="">
<TxRepeat dataTag="TXREC" renderTag="Y" memo="" timesField="" timesValue="-1" name="">
<TxBlock dataTag="Header" renderTag="N" memo="" ref="SystemF-TOTA-BASIC-TxBlock" />
<TxSwitch dataTag="" renderTag="N" memo="" switchField="WARN">
<TxCase dataTag="" renderTag="N" memo="" value="[default]">
<TxRepeat dataTag="TXREC" renderTag="N" memo="" timesField="" timesValue="1" name="">
<TxField id="CNAME" cname="ed" datatype="X" lengthtype="F" padchar=" " justify="" default="" length="80" lengthExpr="" scale="0" tagSize="0" lengthSize="0" encoding="UNISYS" shiftInOut="Y" invisibleChar="TrimAndPadRight" memo="" optional="N" overwrite="N" codec="" renderTag="" charFormat="" />
<TxField id="AVBAL" cname="b7" datatype="S" lengthtype="F" padchar=" " justify="" default="" length="14" lengthExpr="" scale="2" tagSize="0" lengthSize="0" encoding="" shiftInOut="Y" invisibleChar="TrimAndPadRight" memo="" optional="N" overwrite="N" codec="" renderTag="" charFormat="" />
<TxField id="AVG03" cname="hh" datatype="9" lengthtype="F" padchar=" " justify="" default="" length="13" lengthExpr="" scale="2" tagSize="0" lengthSize="0" encoding="" shiftInOut="Y" invisibleChar="TrimAndPadRight" memo="" optional="N" overwrite="N" codec="" renderTag="" charFormat="" />
<TxField id="AVG1" cname="1m" datatype="9" lengthtype="F" padchar=" " justify="" default="" length="13" lengthExpr="" scale="2" tagSize="0" lengthSize="0" encoding="" shiftInOut="Y" invisibleChar="TrimAndPadRight" memo="" optional="N" overwrite="N" codec="" renderTag="" charFormat="" />
</TxRepeat>
</TxRepeat>
</TxCase >
</TxSwitch >
</TxRepeat >
</TxBody>
<TxTail dataTag="" renderTag="Y" memo="" ref="" />
</TOTA>
</TxDef>