PowerShell - Regular ExpressionsIdentify the error in this PowerShell regex command:'test123' -match '\d{3'AMissing closing brace '}' in regex patternBIncorrect use of single quotes around stringCUsing -match instead of -like operatorDNo error, command is correctCheck Answer
Step-by-Step SolutionSolution:Step 1: Inspect the regex pattern '\d{3'The pattern is missing the closing brace '}' for the quantifier, causing a syntax error.Step 2: Check other parts of the commandSingle quotes and -match operator are correct for regex matching.Final Answer:Missing closing brace '}' in regex pattern -> Option AQuick Check:Regex quantifiers need matching braces [OK]Quick Trick: Always close braces in regex quantifiers like {3} [OK]Common Mistakes:Forgetting to close quantifier bracesConfusing -match with -likeThinking quotes cause regex errors
Master "Regular Expressions" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes File and Directory Operations - Get-ChildItem for listing - Quiz 1easy File and Directory Operations - CSV operations (Import-Csv, Export-Csv) - Quiz 9hard Functions - Comment-based help - Quiz 10hard Functions - Why functions organize scripts - Quiz 5medium Functions - Comment-based help - Quiz 4medium Functions - Function definition - Quiz 15hard Regular Expressions - Regex with Select-String - Quiz 5medium Regular Expressions - Named captures - Quiz 10hard Regular Expressions - Regex quantifiers and anchors - Quiz 11easy Working with Objects - Object arrays - Quiz 4medium