Using RegEx Pattern Matching in Microsoft Purview DLP Policies
Short answer
D You should use RegEx pattern matching to define a custom sensitive information type within the Microsoft Purview DLP policy to detect the specific 32-character alphanumeric account numbers in SharePoint Online.
Question
You have Microsoft SharePoint Online sites that contain sensitive documents. The documents contain customer account numbers that each consists of 32
alphanumeric characters.
You need to create a data loss prevention (DLP) policy to protect the sensitive documents.
What should you use to detect which documents are sensitive?
Key Takeaways
The core trap is confusing Azure Information Protection (classification/labeling) with Data Loss Prevention (policy enforcement); for custom non-standard data formats like specific ID lengths, RegEx pattern matching is the required detection method within DLP.
Learn how to protect sensitive SharePoint documents with 32-character alphanumeric IDs by configuring a custom Sensitive Information Type using RegEx pattern matching in Microsoft Purview DLP policies.
Common mistake: Selecting Azure Information Protection (C) because it handles data protection; however, AIP focuses on labeling and encryption, whereas DLP policies rely on Sensitive Information Types defined via RegEx for this specific detection scenario.
Expert Analysis
RegEx Pattern Matching
The question requires identifying a mechanism to detect sensitive documents within a Microsoft 365 DLP policy context. The key constraint is that the sensitive data consists of "customer account numbers that each consists of 32 alphanumeric characters." This describes a specific, structured pattern rather than a generic keyword or a predefined standard info type (like a credit card number).
Why Option C (Azure Information Protection) is the distractor: Azure Information Protection (AIP), now part of Microsoft Purview Information Protection, provides classification and labeling capabilities. While AIP can use pattern matching to detect content for labeling purposes, the question specifically asks about creating a Data Loss Prevention (DLP) policy. DLP policies in Microsoft Purview utilize "Sensitive Information Types" (SITs) to identify content. SITs can be built-in (e.g., US Credit Card Number) or custom. When the data does not fit a standard format, administrators must create a custom SIT using RegEx pattern matching. Therefore, while AIP is related to protection, RegEx is the specific technical component used within the DLP policy definition to identify this unique string pattern.
Why Option D is correct: In Microsoft Purview DLP, you define what constitutes sensitive information by creating Sensitive Information Types. For non-standard formats, such as a 32-character alphanumeric ID, you must define a Regular Expression (RegEx) pattern. The DLP engine then scans SharePoint Online content against these patterns. If a document matches the RegEx pattern, it is flagged as containing sensitive information, triggering the DLP policy actions. Thus, RegEx pattern matching is the direct method used to detect the specific documents described.
Options A and B are incorrect because SharePoint search is for retrieval, not policy enforcement detection, and hunting queries in Microsoft 365 Defender are for threat investigation, not automated DLP content scanning.
Exam Strategy
When asked about DLP policy detection mechanisms, always look for 'Sensitive Information Types' or 'Pattern Matching'. If the data format is non-standard (not a credit card, SSN, etc.), the answer is almost certainly 'RegEx' or 'Custom Sensitive Information Type'. Do not confuse DLP detection with AIP labeling or Purview sensitivity labels, even though they share underlying technology.
Frequently Asked Questions
What is a Sensitive Information Type (SIT) in Microsoft Purview?
Can I use RegEx for both DLP and Azure Information Protection?
How do I test if my RegEx pattern works in SharePoint?
Community Votes
64% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 68 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 30 of 68
-
teehex 👍 66Azure API is the correct answer. The question is asking what you need. It is not asking you how to do it. You must use Azure AIP as a tool for DLP. And then Regex is a way to build your pattern in case there is not any built-in sensitive pattern type that supports your case (account number with 32 char). So bonus the regex ^[a-zA-Z0-9]{32}$
-
stromnessian 👍 21 Answered CYou would use both C and D, so as with many MS exam questions, toss a coin, pick your answer and hope for the best.
-
Lone__Wolf 👍 5 Answered DD. RegEx pattern matching To detect sensitive documents in SharePoint Online, you can use a RegEx (regular expression) pattern matching rule in the data loss prevention (DLP) policy. A RegEx pattern is a sequence of characters that defines a search pattern, which can be used to match specific sequences of characters in the documents. In this scenario, you can use a RegEx pattern to match the customer account numbers, which consist of 32 alphanumeric characters. By using a RegEx pattern, you can accurately identify the sensitive documents that contain the customer account numbers and take appropriate action, such as blocking access to the documents or sending notifications to the appropriate users. Once you have defined the RegEx pattern, you can create a DLP policy in Microsoft Defender for Office 365 that uses the pattern to detect sensitive documents. The DLP policy can then be configured to take appropriate action, such as blocking access to the sensitive documents or sending notifications to the appropriate users.
-
Max_DeJaV 👍 5 Answered DI tried to apply the different solution, but only D seems to be correct, below the steps I followed in my environment: Open the Microsoft Pureview portal: 1) Create a new classifier: - Data Classification -> Classifiers -> Sensitive Info Type -> Create a new classifier with the regex (32 alphanumeric characters) https://learn.microsoft.com/en-us/purview/create-a-custom-sensitive-information-type?view=o365-worldwide 2) Create the DLP rule (using the previously created classifier) - Data Loss Prevention -> Policies -> Create a policy and using the previously created classifier. AIP uses labels, and I couldn't find the option to create them with Regex, moreover this functionality should be part of another plan
-
TechMinerUK 👍 5 Answered DI would say it is D as the question already states you need to make a DLP policy meaning you have chosen the technology which you are going to use. As such the policy would involve a RegEx component in order to protect the data mentioned Whilst you are "protecting" the data it doesn't necesarily need to be AIP, it could be DLP with the RegEx policy to prevent it being sent externally
Show 25 more comments
-
RodrigoLima 👍 5 Answered DAccording to Microsoft Documention: "Microsoft Purview Compliance comes with built-in Sensitive information types like Credit Card Numbers, Bank Accounts, and more. You can also create a custom sensitive info type matched on regular expressions, keywords, or an uploaded dictionary."
-
Kodoi 👍 5 Answered DD is correct; AIP provides a label function but cannot be used for DLP policy conditions;,DLP policies can be regular expressions https://learn.microsoft.com/ja-jp/purview/dlp-policy-learn-about-regex-use
-
Qadour 👍 4Read the question carefully ! We have a Defender for O365 and SPO sites containing sensitive docs and each of these docs contains CUSTOMER ACCOUNT NUMBER ! We need to use a " DLP POLICY" to protect the docs. The question is what should we need to "DETECT" which doc is sensitive ? Answer : " D "
-
examkid 👍 4is correct You could use a RegEx to discover the pattern. But at the end you are still using AIP to discover the documents.
-
doregos 👍 4 Answered Dhttps://learn.microsoft.com/en-us/microsoft-365/compliance/create-a-custom-sensitive-information-type?view=o365-worldwide
-
vvillar 👍 4I think answer is D, Regex
-
Task 👍 4AIP Correct answer
-
CarlosE 👍 3 Answered Chttps://learn.microsoft.com/en-us/azure/information-protection/what-is-information-protection Escáner local: El analizador local permite a los administradores examinar sus repositorios de archivos locales en busca de contenido confidencial que deba etiquetarse, clasificarse o protegerse. El analizador local se instala mediante cmdlets de PowerShell proporcionados como parte del cliente de etiquetado unificado y se puede administrar mediante PowerShell y el área del escáner de protección de la información en el portal de cumplimiento de Microsoft Purview.
-
TeeKay_From_the_South 👍 3One thing I know about Microsoft exams is the Scenario miss leads you. The question says, What should you use to detect which documents are sensitive? The account number in the scenario has nothing to do with the question. The answer is Azure Information Protection. what you should be thinking is sensitivity labels not how to do it.
-
Holii 👍 3Which makes it even worse as a question- since MIP, now named MPIP, handles SPO/cloud-based scanning and classification. AIP is for on-prem data, yet still is referenced as AIP universally as a stand-in for MPIP even today. Microsoft really needs to get their naming down.
-
Benkyoujin 👍 3Is it though? https://docs.microsoft.com/en-us/exchange/security-and-compliance/data-loss-prevention/create-custom-dlp-policy The question is poorly worded but says you have MDO, not AIP. Plus isn't AIP in scope for sc-400?
-
Chris2pher 👍 3The key word is "use to detect" AIP is a tool right? And it uses the regex to "detect". So I think its Regex that is used to detect not the tool AIP.
-
gyaansastra 👍 3True, the question clearly mentioned about detection of 32 alphanumeric characters. AIP can only focus on label.
-
MILOP88 👍 3 Answered Dhttps://learn.microsoft.com/en-us/microsoft-365/compliance/create-test-tune-dlp-policy?view=o365-worldwide
-
kabooze 👍 3 Answered Dhttps://learn.microsoft.com/en-us/purview/dlp-policy-learn-about-regex-use
-
Abhishek1610 👍 3 Answered CYou need to use Azure Information Protection
-
Apocalypse03 👍 3 Answered DRegEx pattern matching
-
jrjrjrchlv 👍 2 Answered CYou should use C. Azure Information Protection to detect which documents are sensitive. Azure Information Protection is a data protection service that can be used to classify and label documents, and to set up data loss prevention (DLP) policies to protect sensitive documents. It can detect documents that contain sensitive information, such as customer account numbers, using pattern matching, machine learning, and pre-defined rules. You can use Azure Information Protection to classify and protect documents in SharePoint Online, as well as in other file storage and collaboration platforms.
-
bentaja 👍 2it sounds like you want to use RegEx pattern matching to detect which documents are sensitive. RegEx, or regular expression, is a type of pattern matching that can be used to identify specific patterns of characters in a string of text. In this case, you can use a RegEx pattern to match the 32-character account numbers in your sensitive documents. This will allow you to create a DLP policy that can detect and protect these sensitive documents.
-
Contactfornitish 👍 2 Answered DSharpoint has separate section for DLP policies, which wouldn't need AIP in particular. Simply create a DLP policy and use regx. There are many orgs which do not use AIP due to licensing reasons, doesn't mean that their sharepoint would not need to be protected https://social.technet.microsoft.com/wiki/contents/articles/36527.implement-data-loss-prevention-dlp-in-sharepoint-online.aspx
-
ERROR505 👍 2 Answered DD. RegEx pattern matching is the best option to detect which documents contain sensitive information in this scenario. You can create a DLP policy that uses RegEx to scan the contents of documents for the specific pattern of 32 alphanumeric characters that represent customer account numbers. This will help identify and protect the sensitive documents in your SharePoint Online sites.
-
ACSC 👍 2 Answered CAzure Information Protection (AIP) is part of Microsoft Purview Information Protection (formerly Microsoft Information Protection or MIP). Microsoft Purview Information Protection helps you discover, classify, protect, and govern sensitive information wherever it lives or travels.
-
4b097e5 👍 2D should be the correct answer as DLP policies in SharePoint and OneDrive for work or school web clients support various conditions and actions. You can define sensitive information types (SITs) or use regular expressions (RegEx) to match content and enforce protection.
-
doregos 👍 2 Answered DCreating custom Information type using regeneration is the correct answer. AIP allows you create labels but not custom information types. https://docs.microsoft.com/en-gb/microsoft-365/compliance/create-a-custom-sensitive-information-type?view=o365-worldwide
-
1a144a0 👍 2 Answered DYou can use a regex in Microsoft Purview Data Loss Prevention (DLP) to define patterns that help you identify and classify sensitive data, or to help detect patterns in content. https://learn.microsoft.com/en-us/purview/dlp-policy-learn-about-regex-use
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SC-200 Questions
Access 80 questions with complete answers and detailed explanations.
View Full SC-200 Practice Test →