Safari do not support lookbehind in regular expression.
Fixes: https://tracker.ceph.com/issues/53665
Signed-off-by: 胡玮文 <huww98@outlook.com>
(cherry picked from commit
d4b239c63595e1dc9772a135bf6b9c0608f852ce)
// pattern to replace range [0-5] to [0..5](valid expression for brace expansion)
// replace any kind of brackets with curly braces
return hostname
- .replace(/(?<=\d)\s*-\s*(?=\d)/g, '..')
+ .replace(/(\d)\s*-\s*(\d)/g, '$1..$2')
.replace(/\(/g, '{')
.replace(/\)/g, '}')
.replace(/\[/g, '{')