Versions in this module Expand all Collapse all v0 v0.1.0 Apr 27, 2021 Changes in this version + const PRESERVE_REPL1 + const PRESERVE_REPL2 + func BuildRegexp(search string, ...) (regX *regexp.Regexp, err error) + func IsTextFile(filename string, minSizeLimit, maxSizeLimit int64) (isText, gtLimit bool, err error) + func ReplaceInFile(filename, search, replace string, doBackup ...bool) (found bool, err error) + func WriteTextFile(filename, data string, appendIfExist ...bool) error + type LinesInfos struct + Count int + Eol string + FoundLinesIdx []lineIdxInf + UntouchedLines []int + WordsPosIdx [][]int + func LinesInfosBuild(textByte *[]byte, patternPos [][]int) (li LinesInfos) + type SearchAndReplace struct + CaseSensitive bool + DoBackup bool + DoReplace bool + Filename string + OccReplaced int + Occurrences int + OnEachLine func(idx, lineStart, lineEnd int) + Pos LinesInfos + PosixCharClass bool + PosixStrictMode bool + Regex bool + ReplaceWith string + TextBytes []byte + TextBytesMd5 string + ToSearch string + ToSearchRegexp *regexp.Regexp + UseEscapeChar bool + UseEscapeCharToRepl bool + WholeWord bool + Wildcard bool + func SearchAndReplaceNew(filename string, textBytes []byte, toSearch, replaceWith string) (s *SearchAndReplace) + func (s *SearchAndReplace) HasBeenDisplayed(set ...bool) bool + func (s *SearchAndReplace) Init(textBytes []byte, toSearch, replaceWith string, ...) (err error) + func (s *SearchAndReplace) IsReadyToReplace() bool + func (s *SearchAndReplace) ReplaceInFile() error + func (s *SearchAndReplace) Reset() + func (s *SearchAndReplace) SearchAndReplace() (err error) + type SearchAndReplaceFiles struct + FileName string + NotTextFile bool + Occurrences int + SearchAndRepl SearchAndReplace + func SearchAndReplaceInFiles(filenames []string, toSearch, replaceWith string, ...) (founds []SearchAndReplaceFiles, occurFound int, err error)