As far as I can tell from the highly folded (not to mention possibly spindled and mutilated) example text given in the OP, the string 'Total SE ON' seems to occur on its own line, but is preceded by a bunch of spaces and followed by bunches of spaces, dashes and spaces before a bunch of digits occurs. (There is a previous line with 'Total SE ON' also, but this seems to be preceded by a '|' (pipe) character and has no digits anywhere after it.)
In other words, the line you want to match looks like this (but with fewer spaces and dashes):
' Total SE ON ---- 1234 '
If this is the case, I do not see why the original regex would not work with line-by-line processing if only the requirement that 'Total ...' be anchored at the start of the line (the function of the '^' (hat) regex metacharacter), i.e., that it have no characters before it, would be removed.
Also, in the context of line-by-line processing, the //s regex modifier, which switches on 'dot-matches-all' regex behavior, is pointless.
Further, the regex /Total SE ON\D+(\d+)/ would seem to more clearly express what you are trying to achieve (the \D regex character class represents any character not a digit): it's always best to try to 'say what you mean' with regexen.
In reply to Re: One liner
by AnomalousMonk
in thread One liner
by manav_gupta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |