PowerShell - Regular ExpressionsWhich of the following is the correct PowerShell regex pattern to match exactly three digits at the end of a string?A\d{3}$B^\d{3}C\d{3}^D^\d{3}$Check Answer
Step-by-Step SolutionSolution:Step 1: Understand anchors for string positions^ matches start, $ matches end of string.Step 2: Match exactly three digits at the endPattern ^\d{3}$ matches exactly three digits at the start and end of the string.Final Answer:^\d{3}$ -> Option DQuick Check:Pattern ^\d{3}$ = exactly three digits at start and end [OK]Quick Trick: Use ^ and $ to anchor pattern at string start and end [OK]Common Mistakes:Using ^ instead of $ for end of stringPlacing anchors incorrectlyMisusing escape sequences
Master "Regular Expressions" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes Error Handling - Try-Catch-Finally - Quiz 1easy Error Handling - Throw statement - Quiz 14medium File and Directory Operations - Reading file content (Get-Content) - Quiz 12easy Functions - Default parameter values - Quiz 15hard Functions - Why functions organize scripts - Quiz 6medium Functions - Why functions organize scripts - Quiz 2easy Functions - Default parameter values - Quiz 5medium Modules and Script Organization - Script modules vs binary modules - Quiz 3easy Regular Expressions - Common regex patterns - Quiz 5medium Working with Objects - Why PowerShell is object-oriented - Quiz 3easy