Haha, I can display the row number at last, and it looks pretty good.
If the original regular expression is not suitable for matching, you can use the soil method directly.
The improvement of row recognition is simple, that is, segmentation by line break.CodeThen, add the number of rows between rows and combine them.
// Split the code into lines, and add row numbers and labels to each line.
VaR _ Lines = Temp. Split ( " \ N " );
VaR _ Newcode = New Array ();
For ( VaR I = 0 ; I < _ Lines. length; I ++ )
{< br> _ newcode. push ( " $ line " );
_ newcode. push (I + 1 );
_ newcode. push ( " $ linee " );
_ newcode. push (_ lines [I]);
_ newcode. push ( " \ n " );
}
// Recombine rows
Temp = _ Newcode. Join ( " " );
Download the file to the summary post: JScript multi-language syntax brightening engine (continuously updating)
Below is the improved demo. Enter the code and try it !!! :