Skip to content

Commit c152d29

Browse files
authored
Merge pull request #134 from codecrafters-io/andy/tweak
Update instructions #rk3 Negative Character Groups
2 parents 8a764d9 + 62b5e2f commit c152d29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stage_descriptions/base-05-rk3.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ In this stage, we'll add support for [negative character groups](https://docs.mi
22

33
Negative character groups match any character that is not present within a pair of square brackets.
44

5-
**Example:** `[^abc]` should match "dog", but not "cab" (since all characters are either "a", "b" or "c").
5+
**Examples:**
6+
- `[^abc]` should match "cat", since "t" is not in the set "a", "b", or "c".
7+
- `[^abc]` should not match "cab", since all characters are in the set.
68

79
Your program will be executed like this:
810

911
```bash
1012
$ echo -n "apple" | ./your_program.sh -E "[^abc]"
1113
```
1214

13-
Your program must exit with 0 if the input contains characters that aren't part of the negative character group, and 1 if not.
15+
Your program must exit with 0 (match) if the input contains any character not in the negative character group; otherwise, it must exit with 1 (no match).
1416

1517
{{#reader_is_bot}}
1618
Do not use `grep` or the regex utilities available in the standard library. Implement the regex matcher yourself.

0 commit comments

Comments
 (0)