.#ý( srchmiscþ ' require,* # str # dir+* ! n ! s " s1 # fun # len+ý # strþ & strlen°# len}' fsearch°# fun # dir! 0=.}' bsearch°# fun/cý # str" \nþ ) is_substr°! n ! n.ý # strþ # funM. # lenw/c" -1w/bý # str! 1 ! nþ & substr°! sý # str ! n! 19ý # strþ & strlenþ & substr°" s1ý ! sþ & strlen°! n ) push_mark.ý ! sþ # funM/.ý ! nþ ( go_rightý " s1þ * looking_at.ý ! nþ ' go_left * pop_mark_0 # lenw/c # dir! 0=.ý ! nþ ' go_left/c/f * pop_mark_1" -1y3 search_across_lines,* # pat+* " cs+ + CASE_SEARCH°" csý # patþ & strlow # patB.! 1°+ CASE_SEARCH/c " csw‚1 setup_case_search,* & prompt # dir + line_ok_fun+* # str ) not_found+! 1°) not_foundý & prompt + LAST_SEARCH + Null_Stringþ ) read_mini°# strý # strþ & strlen.w/b ) push_mark* " cs+ý # strþ 1 setup_case_search°" cs.ý ) not_foundþ ( pop_mark " cs°+ CASE_SEARCH/n # dir! 0?ý # strþ * looking_atC. * go_right_1/cý # strþ 2 save_search_stringý}3 search_across_lines # str # dir + line_ok_funþ 2 search_maybe_againN°) not_found ) not_found.ý. %s: not found. # strþ & verror/c 3 EXECUTE_ERROR_BLOCKy5 search_generic_search,ý/ Search forward:! 1}2 _function_return_1þ 5 search_generic_searchy. search_forward,ý0 Search backward:" -1}2 _function_return_1þ 5 search_generic_searchy/ search_backward,* # str # len+ý # len # strþ - replace_charsy2 replace_do_replace,* # pat+* # len+ý # patþ & strlen°# lený # pat! 1þ 3 search_across_lines! 0?. # lenw/c" -1wy6 search_search_function,* # pat & prompt # rep +* * has_prefix+ý( Replace: + Null_String + Null_Stringþ ) read_mini°# patý # patþ & strlen.w/býý) Replace ' # patþ & strcat' ' with:þ & strcat°& promptý & prompt  þ ) read_mini°# rep* " cs+ý # patþ 1 setup_case_search°" cs. " cs°+ CASE_SEARCH/ný }6 search_search_function # pat # rep! 1}2 replace_do_replaceþ 2 replace_with_query 3 EXECUTE_ERROR_BLOCKý% done.þ ' messagey+ replace_cmdý& searchþ ' provide