Я пытаюсь получить от этого:
1200 PORTAL oracle 29489 17:57 48 username cell single block physical read 2
к этому:
EXEC SYS.KILLSID (1200,29489,2)
find ^(\d{1,4}) [^\d]\*(\d{4,5}) .*(\d)$
replace EXEC SYS.KILLSID (\1,\2,\3)
^(\d{1,4})\D+(\d{4,5}).+(\d)$
EXEC SYS.KILLSID \($1,$2,$3\)
. matches newline
Объяснение:
^ : begining of line
(\d{1,4}) : group 1, 1 to 4 digits
\D+ : 1 or more non digits
(\d{4,5}) : group 2, 4 or 5 digits
.+ : 1 or more any character but newline
(\d) : group 3, 1 digit
$ : end of line
Замена:
EXEC SYS.KILLSID : literally
\( : open parenthesis, in Npp, it has to be escaped
$1 : content of group 1
, : a comma
$2 : content of group 2
, : a comma
$3 : content of group 3
\( : close parenthesis, in Npp, it has to be escaped
Результат для данного примера:
EXEC SYS.KILLSID (1200,29489,2)