Search code examples
javascriptace-editor

ace js find string in pre-defined line


how is it possible to find all the appearances of a string inside a pre-defined line? e.g. I want to find the string ":

editor.findAll('"',{regExp:false});
editor.replace(""); 

This would replace all ". But how is it possible to say: I want to replace the " in line 6?

TY!


Solution

  • ace allows to pass a range to find/findAll

    Range = require("ace/range").Range;
    editor.findAll(' ', {
        regExp: false, 
        range: new Range(row, 0, row, Number.MAX_VALUE)
    });