Identifying Files by Naming Pattern in Purview Auto-Apply Policies

SC-401 By islever Editorial Last updated

Short answer

C Use a sensitive info type to identify files by applying a regular expression pattern to the file names.

Question

At the end of a project, you upload project documents to a Microsoft SharePoint Online library that contains many files. The following is a sample of the project document file names:
• aei_AA989.docx
• bci_WS098.docx
• cei_DF112.docx
• ebc_QQ454.docx
• ecc_BB565.docx
All documents that use this naming format must be labeled as Project Documents:
You need to create an auto-apply retention label policy.
What should you use to identify the files?
  1. A retention label
  2. A trainable classifier
  3. A sensitive info type Correct Answer

Key Takeaways

The trap is confusing content-based ML tools (Trainable Classifiers) with rule-based pattern detectors (SITs) for file name matching.

Learn how to use Sensitive Info Types with regular expressions to auto-apply retention labels to SharePoint files based on their naming format in SC-401.

Common mistake: Choosing B (Trainable Classifier) because it handles complex patterns, but it is unnecessary and less precise for simple regex file name matching compared to SITs.

Expert Analysis

Pattern Matching for File Names

The scenario requires auto-applying a retention label to files based on a specific naming convention (e.g., aei_AA989.docx). The key constraint is that the detection criterion is the file name structure, not the content within the document.

Evaluating Trainable Classifiers

Trainable classifiers use machine learning models to identify sensitive information. While powerful, they are generally designed for analyzing document content and metadata patterns that are complex or unstructured. Using a trainable classifier for a simple, static regular expression pattern in a file name is over-engineered and often less precise for strict string matching than dedicated info types.

Sensitivity Information Types (SITs)

Sensitive Information Types (SITs) are rules-based detectors. Microsoft Purview SITs support various data sources, including file names. You can configure a SIT to use a Regular Expression (Regex) to match specific patterns. In this case, a regex like ^[a-z]{3}_[A-Z]{2}\d{3}\.docx$ can precisely identify the required files. This is the standard, documented method for pattern-based detection in file names without requiring ML training.

Conclusion

Since the requirement is a deterministic pattern match on file names, a Sensitive Info Type configured with a Regex is the correct and most efficient tool. Comments suggesting SITs target only content are incorrect; SITs explicitly support file name inspection via regex.

Official Reference

https://learn.microsoft.com/en-us/purview/apply-retention-labels-automatically

This link opens the official vendor documentation in a new tab.

Exam Strategy

When asked to detect specific patterns in file names or emails, look for 'Sensitive Information Types' first. Reserve 'Trainable Classifiers' for when you need to train an ML model on unique, non-standard content that doesn't fit a regex rule.

Frequently Asked Questions

Can Sensitive Info Types detect patterns in file names?

Yes, SITs support detecting sensitive information in file names using Regular Expressions (Regex).

Why not use a Trainable Classifier for file names?

Trainable Classifiers use ML for content analysis. For strict regex patterns in file names, SITs are more direct and accurate.

More SC-401 FAQ →

Community Votes

C
80%
B
20%

80% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 6 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 6

  1. florinvele 👍 6 Answered C
    SIT with a regex as pattern
  2. Eltooth 👍 2 Answered C
    C is correct answer: Sensitive info type https://learn.microsoft.com/en-us/purview/apply-retention-labels-automatically You can configure auto-apply retention label policies based on: Sensitive information types Keywords or searchable properties Trainable classifiers In your scenario, where the filenames follow a structured format like: aei_AA989.docx bci_WS098.docx cei_DF112.docx “You can apply retention labels to content automatically when that content doesn't already have a retention label applied and contains sensitive information, keywords or searchable properties, or a match for trainable classifiers.”
  3. rvln7 👍 2
    SITs are primarily designed for content inspection but they absolutely support pattern‑based detection in file names. So there is no need for machine learning model here, just: ^[a-z]{3}_[A-Z]{2}\d{3}\.docx$ :D
  4. Jideakin 👍 2
    I thought SIT targets content, not file names. I would pick Trainable Classifier here.
  5. martinods 👍 1
    please share the documentation link to support this
Show 1 more comment
  1. rvln7 👍 1 Answered C
    CORRECT SIT- regex

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

← Back to SC-401 Study Guide