Need regular expression to parse a log line, I have to select data after 10th occurrences of pipe symbol |
Sample log line;
Info device Allow:FWD|TCP|data1|data2|data3|data4|data5|data6|data7|data8|data9|data10|data11|0|1|0|0|0|0||||||
I have to select data9 from above log line.
Below is the expression I am using right now, this is for a Java program
Expresssion:
\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|([^|]*)\|
selection group 11
Instead of escape character one by one would like to skip/ignore 10 pipe symbols and select data9
data10
, notdata9
. (However, it won't actually match at all since you are matching 1 too many pipe symbols, or there is a pipe symbol missing from the "sample log line"?)