/usr/share/jed/lib/regexp.sl is in jed-common 1:0.99.19-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | %
% Interactive Regular expression searches. These highlight region matched
% until next key is pressed.
%
require ("srchmisc");
define re_search_dir (pat, dir)
{
variable ret;
if (dir > 0) ret = re_fsearch (pat); else ret = re_bsearch (pat);
ret--; ret;
}
define re_search_forward()
{
variable pat, not_found = 1;
pat = read_mini("Search (Regexp):", Null_String, Null_String);
!if (strlen(pat)) return;
push_mark();
ERROR_BLOCK
{
pop_mark (not_found);
}
not_found = not (search_maybe_again (&re_search_dir, pat, 1,
&_function_return_1));
if (not_found) error ("Not found.");
EXECUTE_ERROR_BLOCK;
}
define re_search_backward()
{
variable pat, not_found;
pat = read_mini("Backward Search (Regexp):", Null_String, Null_String);
!if (strlen(pat)) return;
push_mark();
ERROR_BLOCK
{
pop_mark (not_found);
}
not_found = not (search_maybe_again (&re_search_dir, pat, -1,
&_function_return_1));
if (not_found) error ("Not found.");
EXECUTE_ERROR_BLOCK;
}
private define research_search_function (pat)
{
re_fsearch (pat) - 1;
}
private define re_replace_function (str, len)
{
!if (replace_match(str, 0))
error ("replace_match failed.");
-2;
}
define query_replace_match()
{
variable pat, n, rep, prompt, doit, err, ch;
err = "Replace Failed!";
pat = read_mini("Regexp:", Null_String, Null_String);
!if (strlen(pat)) return;
prompt = strcat (strcat ("Replace '", pat), "' with:");
rep = read_mini(prompt, Null_String, Null_String);
replace_with_query (&research_search_function, pat, rep, 1,
&re_replace_function);
}
|