After using [regex]
type accelerator, Options property is ReadOnly and can't be changed. But you can call a constructor with RegexOptions parameter:
$regex = [System.Text.RegularExpressions.Regex]::new('^([0-9]{1,20})(b|kb|mb|gb|tb)$','IgnoreCase')
To pass multiple options use bitwise or operator on underlying values:
$regex = [regex]::new('^([0-9]{1,20})(b|kb|mb|gb|tb)$',[System.Text.RegularExpressions.RegexOptions]::Multiline.value__ -bor [System.Text.RegularExpressions.RegexOptions]::IgnoreCase.value__)
But simple addition seems to work, too:
[System.Text.RegularExpressions.RegexOptions]::Multiline + System.Text.RegularExpressions.RegexOptions]::IgnoreCase
It would even work when supplied numeric flag (35 = IgnoreCase=1 + MultiLine=2 + IgnorePatternWhitespace=32), altough relying on enum values directly is usually not a best practice:
$regex = [regex]::new('^([0-9]{1,20})(b|kb|mb|gb|tb)$',36)
$regex.Options