I have a string
let str = 'a12b-a24b';
And I'm replacing the alphabets and splitting the string into two parts
let [result1, result2] = str.replace(/a/g,'').replace(/b/g,'').split('-');
I want to divide the numbers by a constant say 2 before assigning them to result1 and result2 respectively.