I'm creating a code that only takes out certain strings in the first column of the spreadsheet, but it doesn't work.
I would appreciate it if you could point it out.
function myFunction(){
const sheet = SpreadsheetApp.getActiveSheet();
constlastRow=sheet.getLastRow();
for(leti=2;i<=lastRow;i++){
var str = sheet.getRange(i,1).getValue();
console.log(str.match(/{regular expression for specific characters}/g));
}
}
The regular expression seems to have been incorrect, so I changed it to "+" → ".*" in the regular expression category and it worked.
© 2024 OneMinuteCode. All rights reserved.