public sealed class CloudStorageRegex : IMessage<CloudStorageRegex>, IEquatable<CloudStorageRegex>, IDeepCloneable<CloudStorageRegex>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Data Loss Prevention v2 API class CloudStorageRegex.
A pattern to match against one or more file stores. At least one
pattern must be specified. Regular expressions use RE2
syntax; a guide can be found
under the google/re2 repository on GitHub.
Optional. Regex to test the bucket name against. If empty, all buckets
match. Example: "marketing2021" or "(marketing)\d{4}" will both match the
bucket gs://marketing2021
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCloudStorageRegex\u003c/code\u003e class in the Google Cloud Data Loss Prevention v2 API is used to define patterns for matching against file stores.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eCloudStorageRegex\u003c/code\u003e is 4.16.0, and multiple previous versions are available for reference.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCloudStorageRegex\u003c/code\u003e allows specifying regex patterns for \u003ccode\u003eBucketNameRegex\u003c/code\u003e and \u003ccode\u003eProjectIdRegex\u003c/code\u003e, offering options to match specific or all buckets and projects.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCloudStorageRegex\u003c/code\u003e implements multiple interfaces like IMessage, IEquatable, IDeepCloneable, and IBufferMessage, providing varied functionalities.\u003c/p\u003e\n"],["\u003cp\u003eThe class \u003ccode\u003eCloudStorageRegex\u003c/code\u003e has two constructors, one of which accepts another \u003ccode\u003eCloudStorageRegex\u003c/code\u003e to create a new object, and it inherits basic methods like \u003ccode\u003eGetHashCode\u003c/code\u003e and \u003ccode\u003eToString\u003c/code\u003e from the \u003ccode\u003eobject\u003c/code\u003e class.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Data Loss Prevention v2 API - Class CloudStorageRegex (4.19.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.19.0 (latest)](/dotnet/docs/reference/Google.Cloud.Dlp.V2/latest/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.18.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.18.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.17.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.17.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.16.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.16.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.15.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.15.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.14.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.14.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.13.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.13.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.12.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.12.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.11.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.11.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.10.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.10.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.9.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.9.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.8.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.8.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.7.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.7.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.6.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.5.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.4.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.3.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.2.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.1.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/4.0.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/3.5.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/3.4.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/3.3.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/3.2.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [2.16.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/2.16.0/Google.Cloud.Dlp.V2.CloudStorageRegex)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Dlp.V2/2.15.0/Google.Cloud.Dlp.V2.CloudStorageRegex) \n\n public sealed class CloudStorageRegex : IMessage\u003cCloudStorageRegex\u003e, IEquatable\u003cCloudStorageRegex\u003e, IDeepCloneable\u003cCloudStorageRegex\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Data Loss Prevention v2 API class CloudStorageRegex.\n\nA pattern to match against one or more file stores. At least one\npattern must be specified. Regular expressions use RE2\n[syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found\nunder the google/re2 repository on GitHub. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CloudStorageRegex \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CloudStorageRegex](/dotnet/docs/reference/Google.Cloud.Dlp.V2/latest/Google.Cloud.Dlp.V2.CloudStorageRegex), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CloudStorageRegex](/dotnet/docs/reference/Google.Cloud.Dlp.V2/latest/Google.Cloud.Dlp.V2.CloudStorageRegex), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CloudStorageRegex](/dotnet/docs/reference/Google.Cloud.Dlp.V2/latest/Google.Cloud.Dlp.V2.CloudStorageRegex), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Dlp.V2](/dotnet/docs/reference/Google.Cloud.Dlp.V2/latest/Google.Cloud.Dlp.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Dlp.V2.dll\n\nConstructors\n------------\n\n### CloudStorageRegex()\n\n public CloudStorageRegex()\n\n### CloudStorageRegex(CloudStorageRegex)\n\n public CloudStorageRegex(CloudStorageRegex other)\n\nProperties\n----------\n\n### BucketNameRegex\n\n public string BucketNameRegex { get; set; }\n\nOptional. Regex to test the bucket name against. If empty, all buckets\nmatch. Example: \"marketing2021\" or \"(marketing)\\\\d{4}\" will both match the\nbucket gs://marketing2021\n\n### ProjectIdRegex\n\n public string ProjectIdRegex { get; set; }\n\nOptional. For organizations, if unset, will match all projects."]]