Note: I tagged the google-app-script because that's where I work and I don't know if there might be some different nomenclatures that are important for everyone to know when answering the question.
Currently, to find the scores (in the example below it is 0-0) that appear between fixed characters 'FT ' and ')', I do it this way:
var text = 'So its (just 1-2) amazing (FT 0-0) its ours final score';
var length = text.length;
var find_str_ft = 'FT ';
var find_str_ft_length = find_str_ft.length;
var position = text.indexOf(find_str_ft);
var text_right = text.substring(position + find_str_ft_length, length);
var find_str_close_bar = ')';
var position_close_bar = text_right.indexOf(find_str_close_bar);
var text_left_close_bar = text_right.substring(0, position_close_bar);
Logger.log(text_left_close_bar);
log:
0-0
I understand that it is an archaic method and and i would like to know if there is more advanced and correct options to work with, even so that it doesn't take so many steps and/or so many lines of code for this.
