5

My text is:

My favourite singer is {Bruce Springsteen} and he was born in New Jersey.

I want to programmatically select the text between the curly braces including them. I cannot find a straightforward way.

GRboss
  • 6,239
  • 5
  • 21
  • 20

1 Answers1

10

you can do editor.find("{Bruce Springsteen}") or

var Range = require("ace/range").Range;
editor.selection.setRange(new Range(0, 23, 0, 42));
// use .setRange(.., true) for setting cursor at the beginning of the selection
Mark
  • 18,730
  • 7
  • 107
  • 130
a user
  • 23,300
  • 6
  • 58
  • 90