Bird
0
0

In PowerShell regex, what does the quantifier + mean when used like a+?

easy📝 Conceptual Q11 of 15
PowerShell - Regular Expressions
In PowerShell regex, what does the quantifier + mean when used like a+?
AMatches zero or more occurrences of 'a' in a row
BMatches one or more occurrences of 'a' in a row
CMatches exactly one 'a'
DMatches zero or one occurrence of 'a'
Step-by-Step Solution
Solution:
  1. Step 1: Understand the quantifier '+' meaning

    The '+' quantifier means "one or more" repetitions of the preceding character or group.
  2. Step 2: Apply to the example 'a+'

    So, a+ matches strings with at least one 'a' repeated consecutively.
  3. Final Answer:

    Matches one or more occurrences of 'a' in a row -> Option B
  4. Quick Check:

    '+' means one or more repetitions [OK]
Quick Trick: Remember '+' means at least one repetition [OK]
Common Mistakes:
  • Confusing '+' with '*' which means zero or more
  • Thinking '+' matches exactly one occurrence
  • Mixing '+' with '?' which means zero or one

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes