The invention relates to a multi-line
text searching and replacing method and
system, and the method comprises the steps: carrying out the preprocessing of an original multi-line text, a multi-line searching content and a multi-line replacing content, removing the head and
tail spaces of each line, and obtaining a corresponding logic text, a logic searching content and a logic replacing content, judging whether the logic search content contains a preset
wildcard character or not, if the logic search content does not contain the preset
wildcard character, carrying out simple character string matching on the logic text to obtain a logic index search result, converting the logic index search result into an original character index by utilizing a preset
index mapping relation for positioning, and executing simple replacement operation, and if the logic search content contains the preset
wildcard character, carrying out simple character string matching on the logic text to obtain a logic index search result; and if the logic text is matched with the fuzzy item
list, regarding the logic search content as an integral matching block, performing sliding comparison according to rows in a row array corresponding to the logic text, if the matching succeeds, extracting the fuzzy item
list and the starting and stopping row indexes of the matching block, performing positioning by utilizing an
index mapping relation, and executing fuzzy replacement operation of inserting the fuzzy item
list into a placeholder.