let myText = "An available reservation is needed for allocation within the StorageGroup1 group. The requested storage amount is 330 GB.";
let myPattern = /An available reservation is needed for allocation within the StorageGroup(\d) group. The requested storage amount is (.*) GB./g;
let result = myPattern.exec(myText);
if (result != null) {
let storageGroup = result[1];
let sizeRequested = result[2];
}
You can adjust myPattern to suit your requirements, I included the full sentences in it for precautionary measures.
http://jsfiddle.net/xbvpsp19/
UPDATE following @krispykream4's feedback:
If the group name could change, you can use the following:
let myUpdatedText = "An available reservation is needed for allocation within the StorageGroup1 group. The requested storage amount is 330 GB.";
let myUpdatedPattern = /An available reservation is needed for allocation within the (\w*)(\d) group. The requested storage amount is (.*) GB./g;
let updatedResult = myUpdatedPattern.exec(myUpdatedText);
if (updatedResult != null) {
let storageGroupName = updatedResult[1];
let specificGroup = updatedResult[2];
let storageSize = updatedResult[3];
}
http://jsfiddle.net/LhL0w232