Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to match all lowercase letters in the string.
Bash Scripting
echo "abc123" | grep -o '[[1]]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase letters range [A-Z] instead of lowercase.
Using digits range [0-9] which matches numbers, not letters.
✗ Incorrect
The character class [a-z] matches all lowercase letters from a to z.
2fill in blank
mediumComplete the code to match all digits in the string.
Bash Scripting
echo "abc123" | grep -o '[[1]]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using letter ranges like [a-z] instead of digits.
Using uppercase letter ranges [A-Z] which do not match digits.
✗ Incorrect
The character class [0-9] matches all digits from 0 to 9.
3fill in blank
hardFix the error in the code to match lowercase letters only.
Bash Scripting
echo "Hello123" | grep -o '[[1]]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase letters range [A-Z] which matches uppercase letters.
Using combined ranges like [A-Za-z] which matches both cases.
✗ Incorrect
To match lowercase letters only, use the range [a-z].
4fill in blank
hardFill both blanks to match lowercase letters and digits separately.
Bash Scripting
echo "a1b2c3" | grep -o '[[1]]' | sort | uniq && echo "a1b2c3" | grep -o '[[2]]' | sort | uniq
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing uppercase letters in the ranges.
Using the same range for both blanks.
✗ Incorrect
Use [a-z] to match lowercase letters and [0-9] to match digits.
5fill in blank
hardFill all three blanks to create a grep pattern matching lowercase letters, digits, and uppercase letters.
Bash Scripting
echo "aA1bB2cC3" | grep -o '[[1][2][3]]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or other characters that do not match letters or digits.
Separating ranges into multiple character classes instead of combining.
✗ Incorrect
Combine ranges [a-z], [0-9], and [A-Z] inside one character class to match all lowercase letters, digits, and uppercase letters.