function convertOctalToHex(inputString) { return inputString.replace(/\\([0-7]{1,3})/g, function(match, octal) { const decimal = parseInt(octal, 8); const hexadecimal = decimal.toString(16); return "\\x" + hexadecimal.padStart(2, "0"); }); } let r = convertOctalToHex('\033[32m')
```
\x1B[32m
```