I'm trying to capture the number 10.0006 from the line:
total time: 10.0006s
which is one line in a text file. So far I have:
var doc = DocumentApp.openByUrl('removed url').getBody().editAsText();
//locate totalTime text
var regEx = "/(?<=total time: )([\d\.]+[\d])(?=s)/";
var totalTime = doc.findText(regEx).getElement().getText();
//display values in log
Logger.log(totalTime);
According to https://developers.google.com/apps-script/reference/document/text#findText(String) capture groups are not supported with findText, are there any other ways to capture the pattern? Thanks in advance!