Getting line of a search term - Python Script for Notepad++ -
i'm trying automate deleting of text on html code i'm editing on notepad++, i'm using plugin pythonscript that. have 1 problem: want delete, example, <center> except first one. thought use function:
editor.rereplace("search", "replace"[, flags[, startposition[, endposition[, maxcount]]]]) since don't want delete first term, set startposition 1 line after 1 first term.the problem don't find scintilla function in python script locate text looking for. maybe research function find solution:
editor.research(search, matchfunction[, flags[, startposition[, endposition[, maxcount]]]]) but can't find function associated .research me.
matches = [] def match_found(m): # append match start position matches array matches.append(m.end(0)) editor.research('pattern', match_found) matches[0] #should contain index of *end* of first match m.end() since want use end of match start of next search
Comments
Post a Comment