1️⃣ Base Stage
Match digits

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 16.1 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Match word characters

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 18 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'blueberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'APPLE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '608' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%+÷_=+×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=%-+×#' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Positive Character Groups

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 15.6 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'r' | ./your_program.sh -E '[blueberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'rac' | ./your_program.sh -E '[blueberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'orange' | ./your_program.sh -E '[bcdfhi]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[mango]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'grape' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'ORANGE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '738' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=#+_+%#' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷%×=+#' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Negative Character Groups

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 28.9 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'r' | ./your_program.sh -E '[raspberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'rcd' | ./your_program.sh -E '[raspberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'pineapple' | ./your_program.sh -E '[bcdfghjkm]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[blueberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'raspberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'GRAPE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '820' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#×÷_×-=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷×%#=+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Combining Character Classes

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 16.9 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'o' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'obc' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'pear' | ./your_program.sh -E '[bcdf]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[mango]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'orange' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'PEAR' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '901' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '+#-_÷#×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷×#%-+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Start of string anchor

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 18.8 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'grape_mango' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'mango_grape' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'a' | ./your_program.sh -E '[pear]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'abc' | ./your_program.sh -E '[pear]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'apple' | ./your_program.sh -E '[bcdfg]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[raspberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'strawberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'APPLE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '582' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%+×_#÷=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%-×+÷=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
End of string anchor

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 13.3 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'raspberry_grape' | ./your_program.sh -E 'grape$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'grape_raspberry' | ./your_program.sh -E 'grape$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pear_pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'orange_grape' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'grape_orange' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'e' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'ebc' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'orange' | ./your_program.sh -E '[bcdfhi]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pear' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'ORANGE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '176' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-%#_×+=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#÷×-%=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Match one or more times

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 24.5 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.1s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'blueberry_apple' | ./your_program.sh -E 'apple$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'apple_blueberry' | ./your_program.sh -E 'apple$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'banana' | ./your_program.sh -E '^banana$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'banana_banana' | ./your_program.sh -E '^banana$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'banana_pear' | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'pear_banana' | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'a' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'abc' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'mango' | ./your_program.sh -E '[bcdef]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'grape' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'PEAR' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '823' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=÷#_%=÷' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%#+-÷×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Match zero or one times

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 14.4 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'pear_mango' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'mango_pear' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'raspberry_raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'strawberry_banana' | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'banana_strawberry' | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'g' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'gbc' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'strawberry' | ./your_program.sh -E '[cdfghijklm]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[blueberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pineapple' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'MANGO' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '249' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-+÷_+÷#' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '+=×-#÷' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Wildcard

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 16.4 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'banana_mango' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'mango_banana' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'grape_blueberry' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'blueberry_grape' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'e' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'ecd' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'banana' | ./your_program.sh -E '[cdefgh]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[pineapple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pear' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'MANGO' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '832' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#÷×_×÷+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=×-÷#+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Alternation

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 28.5 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'pineapple_orange' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_pineapple' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'blueberry' | ./your_program.sh -E '^blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'blueberry_blueberry' | ./your_program.sh -E '^blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'mango_banana' | ./your_program.sh -E '^mango'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'banana_mango' | ./your_program.sh -E '^mango'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'n' | ./your_program.sh -E '[pineapple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'nbc' | ./your_program.sh -E '[pineapple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'strawberry' | ./your_program.sh -E '[cdfghijklm]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pineapple' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'GRAPE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '413' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%+÷_#+÷' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷-%×+=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
2️⃣ Printing Matches
Print a single matching line

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 17.4 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "banana_suffix" | ./your_program.sh -E '^banana'
[your_program] banana_suffix
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_banana" | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "ptest" | ./your_program.sh -E '[plum]'
[your_program] Logs from your program will appear here
[your_program] ptest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "ptest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] goøö0Ogol
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'grape_strawberry' | ./your_program.sh -E 'strawberry$'
[your_program] Logs from your program will appear here
[your_program] grape_strawberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'strawberry_grape' | ./your_program.sh -E 'strawberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[your_program] raspberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'raspberry_raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'strawberry_mango' | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[your_program] strawberry_mango
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'mango_strawberry' | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] sally has 3 apples
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 3 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'a' | ./your_program.sh -E '[pear]'
[your_program] a
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'abc' | ./your_program.sh -E '[pear]'
[your_program] Logs from your program will appear here
[your_program] abc
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'apple' | ./your_program.sh -E '[bcdfg]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[grape]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'grape' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'MANGO' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] MANGO
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '211' | ./your_program.sh -E '\w'
[your_program] 211
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#×+_#+=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] #×+_#+=
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#=×+-÷' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] 123
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Print multiple matching lines

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 24.1 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.1s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "apple\n!@#$\nraspberry\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] apple
[your_program] raspberry
[your_program] test123
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "apple"
[tester::#PZ6] ✓ Found line "raspberry"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\npanda\nitaly\nzebra\nspain" | ./your_program.sh -E '(panda|zebra)'
[your_program] Logs from your program will appear here
[your_program] panda
[your_program] zebra
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "panda"
[tester::#PZ6] ✓ Found line "zebra"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(panda|zebra)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 orange\nINVALID\nLOG 20 corn\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (orange|corn)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 orange
[your_program] LOG 20 corn
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 orange"
[tester::#PZ6] ✓ Found line "LOG 20 corn"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "pear_suffix" | ./your_program.sh -E '^pear'
[your_program] Logs from your program will appear here
[your_program] pear_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "pear_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_pear" | ./your_program.sh -E '^pear'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "ptest" | ./your_program.sh -E '[plum]'
[your_program] ptest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "ptest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'apple_orange' | ./your_program.sh -E 'orange$'
[your_program] apple_orange
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_apple' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'blueberry' | ./your_program.sh -E '^blueberry$'
[your_program] blueberry
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'blueberry_blueberry' | ./your_program.sh -E '^blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'pear_mango' | ./your_program.sh -E '^pear'
[your_program] pear_mango
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'mango_pear' | ./your_program.sh -E '^pear'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'r' | ./your_program.sh -E '[strawberry]'
[your_program] r
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'rcd' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] rcd
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'raspberry' | ./your_program.sh -E '[cdfghijkl]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pear' | ./your_program.sh -E '\w'
[your_program] pear
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'MANGO' | ./your_program.sh -E '\w'
[your_program] MANGO
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '495' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 495
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-+×_#%÷' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] -+×_#%÷
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷#=-+×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] dog
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
3️⃣ Multiple Matches
Print single match

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 16.6 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "banana_suffix" | ./your_program.sh -o -E '^banana'
[your_program] banana
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "banana"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_banana" | ./your_program.sh -o -E '^banana'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "banana\n!@#$\nblueberry\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] banana
[your_program] blueberry
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana"
[tester::#PZ6] ✓ Found line "blueberry"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nrabbit\nitaly\nfox\nspain" | ./your_program.sh -E '(rabbit|fox)'
[your_program] rabbit
[your_program] Logs from your program will appear here
[your_program] fox
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "rabbit"
[tester::#PZ6] ✓ Found line "fox"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(rabbit|fox)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 blueberry\nINVALID\nLOG 20 broccoli\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (blueberry|broccoli)$'
[your_program] LOG 10 blueberry
[your_program] Logs from your program will appear here
[your_program] LOG 20 broccoli
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 blueberry"
[tester::#PZ6] ✓ Found line "LOG 20 broccoli"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "blueberry_suffix" | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[your_program] blueberry_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "blueberry_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_blueberry" | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "stest" | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] stest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "stest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] a cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] caaats
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'grape_blueberry' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[your_program] grape_blueberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'blueberry_grape' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pear_pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'banana_grape' | ./your_program.sh -E '^banana'
[your_program] banana_grape
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'grape_banana' | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'u' | ./your_program.sh -E '[blueberry]'
[your_program] u
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'uac' | ./your_program.sh -E '[blueberry]'
[your_program] Logs from your program will appear here
[your_program] uac
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'grape' | ./your_program.sh -E '[bcdfh]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[raspberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'raspberry' | ./your_program.sh -E '\w'
[your_program] raspberry
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'GRAPE' | ./your_program.sh -E '\w'
[your_program] GRAPE
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '333' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 333
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-÷=_=+-' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] -÷=_=+-
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷%#=-+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Print multiple matches

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 16.9 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "strawberry_pineapple_orange" | ./your_program.sh -o -E '(orange|pineapple|strawberry)'
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] pineapple
[your_program] orange
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "strawberry"
[tester::#SS2] ✓ Found line "pineapple"
[tester::#SS2] ✓ Found line "orange"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 pandas. Also, I see 4 tigers." | ./your_program.sh -o -E 'I see \d+ (panda|tiger)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 pandas
[your_program] I see 4 tigers
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 pandas"
[tester::#SS2] ✓ Found line "I see 4 tigers"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "banana_suffix" | ./your_program.sh -o -E '^banana'
[your_program] banana
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "banana"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_banana" | ./your_program.sh -o -E '^banana'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] dog456
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "orange\n!@#$\nmango\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] orange
[your_program] mango
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "orange"
[tester::#PZ6] ✓ Found line "mango"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nfox\nitaly\nmonkey\nspain" | ./your_program.sh -E '(fox|monkey)'
[your_program] Logs from your program will appear here
[your_program] fox
[your_program] monkey
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "fox"
[tester::#PZ6] ✓ Found line "monkey"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(fox|monkey)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 apple\nINVALID\nLOG 20 onion\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (apple|onion)$'
[your_program] LOG 10 apple
[your_program] LOG 20 onion
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 apple"
[tester::#PZ6] ✓ Found line "LOG 20 onion"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "mango_suffix" | ./your_program.sh -E '^mango'
[your_program] Logs from your program will appear here
[your_program] mango_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "mango_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_mango" | ./your_program.sh -E '^mango'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "atest" | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[your_program] atest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "atest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 1 cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'strawberry_banana' | ./your_program.sh -E 'banana$'
[your_program] strawberry_banana
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'banana_strawberry' | ./your_program.sh -E 'banana$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'grape' | ./your_program.sh -E '^grape$'
[your_program] grape
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'grape_grape' | ./your_program.sh -E '^grape$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'banana_strawberry' | ./your_program.sh -E '^banana'
[your_program] banana_strawberry
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'strawberry_banana' | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 4 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'r' | ./your_program.sh -E '[strawberry]'
[your_program] r
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'rcd' | ./your_program.sh -E '[strawberry]'
[your_program] rcd
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'apple' | ./your_program.sh -E '[bcdfg]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'blueberry' | ./your_program.sh -E '\w'
[your_program] blueberry
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'PEAR' | ./your_program.sh -E '\w'
[your_program] PEAR
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '673' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 673
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-×+_÷+=' | ./your_program.sh -E '\w'
[your_program] -×+_÷+=
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-=#×÷%' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] 123
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] dog
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Process multiple input lines

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 18.2 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like blackberry\nnothing here\nstrawberry and blackberry are tasty" | ./your_program.sh -o -E '(blackberry|strawberry)'
[your_program] Logs from your program will appear here
[your_program] blackberry
[your_program] strawberry
[your_program] blackberry
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "blackberry"
[tester::#BO4] ✓ Found line "strawberry"
[tester::#BO4] ✓ Found line "blackberry"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 wolf and I saw 45 rabbit.\nNothing interesting today.\nLast week I saw 12 rabbits." | ./your_program.sh -o -E 'I saw \d+ (wolf|rabbit)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 wolf
[your_program] I saw 45 rabbit
[your_program] I saw 12 rabbits
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 wolf"
[tester::#BO4] ✓ Found line "I saw 45 rabbit"
[tester::#BO4] ✓ Found line "I saw 12 rabbits"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "apple_raspberry_lemon" | ./your_program.sh -o -E '(lemon|raspberry|apple)'
[your_program] Logs from your program will appear here
[your_program] apple
[your_program] raspberry
[your_program] lemon
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "apple"
[tester::#SS2] ✓ Found line "raspberry"
[tester::#SS2] ✓ Found line "lemon"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 dogs. Also, I see 4 horses." | ./your_program.sh -o -E 'I see \d+ (dog|horse)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 dogs
[your_program] I see 4 horses
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 dogs"
[tester::#SS2] ✓ Found line "I see 4 horses"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "grape_suffix" | ./your_program.sh -o -E '^grape'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "grape"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_grape" | ./your_program.sh -o -E '^grape'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "banana\n!@#$\npear\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] banana
[your_program] pear
[your_program] Logs from your program will appear here
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana"
[tester::#PZ6] ✓ Found line "pear"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\npanda\nitaly\nrabbit\nspain" | ./your_program.sh -E '(panda|rabbit)'
[your_program] Logs from your program will appear here
[your_program] panda
[your_program] rabbit
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "panda"
[tester::#PZ6] ✓ Found line "rabbit"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(panda|rabbit)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 grape\nINVALID\nLOG 20 cauliflower\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (grape|cauliflower)$'
[your_program] LOG 10 grape
[your_program] LOG 20 cauliflower
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 grape"
[tester::#PZ6] ✓ Found line "LOG 20 cauliflower"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "apple_suffix" | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[your_program] apple_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "apple_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_apple" | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "otest" | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[your_program] otest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "otest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] caaats
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'mango_banana' | ./your_program.sh -E 'banana$'
[your_program] Logs from your program will appear here
[your_program] mango_banana
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'banana_mango' | ./your_program.sh -E 'banana$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'mango_strawberry' | ./your_program.sh -E '^mango'
[your_program] mango_strawberry
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'strawberry_mango' | ./your_program.sh -E '^mango'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'a' | ./your_program.sh -E '[banana]'
[your_program] a
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'acd' | ./your_program.sh -E '[banana]'
[your_program] acd
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'blueberry' | ./your_program.sh -E '[acdfghijk]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[pineapple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'mango' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'PINEAPPLE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] PINEAPPLE
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '786' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 786
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%+÷_÷-=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] %+÷_÷-=
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=÷#×+-' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] dog
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
4️⃣ File Search
Search a single-line file

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 24.5 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "pear" > "fruits-4958.txt"
[tester::#DR5] $ ./your_program.sh -E pe.+ fruits-4958.txt
[your_program] pear
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_pear fruits-4958.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+ar fruits-4958.txt
[your_program] pear
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like blueberry\nnothing here\ngrape and blueberry are tasty" | ./your_program.sh -o -E '(blueberry|grape)'
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] grape
[your_program] blueberry
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Found line "grape"
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 tiger and I saw 45 fox.\nNothing interesting today.\nLast week I saw 12 foxs." | ./your_program.sh -o -E 'I saw \d+ (tiger|fox)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 tiger
[your_program] I saw 45 fox
[your_program] I saw 12 foxs
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 tiger"
[tester::#BO4] ✓ Found line "I saw 45 fox"
[tester::#BO4] ✓ Found line "I saw 12 foxs"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "grape_pineapple_pear" | ./your_program.sh -o -E '(pear|pineapple|grape)'
[your_program] Logs from your program will appear here
[your_program] grape
[your_program] pineapple
[your_program] pear
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "grape"
[tester::#SS2] ✓ Found line "pineapple"
[tester::#SS2] ✓ Found line "pear"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 rabbits. Also, I see 4 wolfs." | ./your_program.sh -o -E 'I see \d+ (rabbit|wolf)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 rabbits
[your_program] I see 4 wolfs
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 rabbits"
[tester::#SS2] ✓ Found line "I see 4 wolfs"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "strawberry_suffix" | ./your_program.sh -o -E '^strawberry'
[your_program] Logs from your program will appear here
[your_program] strawberry
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "strawberry"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_strawberry" | ./your_program.sh -o -E '^strawberry'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "raspberry\n!@#$\napple\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] raspberry
[your_program] apple
[your_program] Logs from your program will appear here
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "raspberry"
[tester::#PZ6] ✓ Found line "apple"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nfox\nitaly\ndog\nspain" | ./your_program.sh -E '(fox|dog)'
[your_program] Logs from your program will appear here
[your_program] fox
[your_program] dog
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "fox"
[tester::#PZ6] ✓ Found line "dog"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(fox|dog)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 pear\nINVALID\nLOG 20 spinach\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (pear|spinach)$'
[your_program] LOG 10 pear
[your_program] LOG 20 spinach
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 pear"
[tester::#PZ6] ✓ Found line "LOG 20 spinach"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "pear_suffix" | ./your_program.sh -E '^pear'
[your_program] Logs from your program will appear here
[your_program] pear_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "pear_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_pear" | ./your_program.sh -E '^pear'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "wtest" | ./your_program.sh -E '[watermelon]'
[your_program] wtest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "wtest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] goøö0Ogol
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'raspberry_mango' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[your_program] raspberry_mango
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'mango_raspberry' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pear_pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'apple_strawberry' | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[your_program] apple_strawberry
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'strawberry_apple' | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 4 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'n' | ./your_program.sh -E '[mango]'
[your_program] n
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'nbc' | ./your_program.sh -E '[mango]'
[your_program] Logs from your program will appear here
[your_program] nbc
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'orange' | ./your_program.sh -E '[bcdfhi]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[grape]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'banana' | ./your_program.sh -E '\w'
[your_program] banana
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'GRAPE' | ./your_program.sh -E '\w'
[your_program] GRAPE
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '300' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 300
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '×+-_-+=' | ./your_program.sh -E '\w'
[your_program] ×+-_-+=
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '×+%=-÷' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] dog
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Search a multi-line file

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 17.4 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "blackberry" > "fruits-2376.txt"
[tester::#OL9] [setup] echo "grape" >> "fruits-2376.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-2376.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-2376.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-2376.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 3 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_pumpkin fruits-2376.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E blackberry fruits-2376.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "grape" > "fruits-5324.txt"
[tester::#DR5] $ ./your_program.sh -E gr.+ fruits-5324.txt
[your_program] grape
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_grape fruits-5324.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+ape fruits-5324.txt
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] Logs from your program will appear here
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like mango\nnothing here\nwatermelon and mango are tasty" | ./your_program.sh -o -E '(mango|watermelon)'
[your_program] Logs from your program will appear here
[your_program] mango
[your_program] watermelon
[your_program] mango
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "mango"
[tester::#BO4] ✓ Found line "watermelon"
[tester::#BO4] ✓ Found line "mango"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 rabbit and I saw 45 panda.\nNothing interesting today.\nLast week I saw 12 pandas." | ./your_program.sh -o -E 'I saw \d+ (rabbit|panda)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 rabbit
[your_program] I saw 45 panda
[your_program] I saw 12 pandas
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 rabbit"
[tester::#BO4] ✓ Found line "I saw 45 panda"
[tester::#BO4] ✓ Found line "I saw 12 pandas"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "grape_apple_raspberry" | ./your_program.sh -o -E '(raspberry|apple|grape)'
[your_program] grape
[your_program] apple
[your_program] raspberry
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "grape"
[tester::#SS2] ✓ Found line "apple"
[tester::#SS2] ✓ Found line "raspberry"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 elephants. Also, I see 4 zebras." | ./your_program.sh -o -E 'I see \d+ (elephant|zebra)s?'
[your_program] I see 3 elephants
[your_program] I see 4 zebras
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 elephants"
[tester::#SS2] ✓ Found line "I see 4 zebras"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "orange_suffix" | ./your_program.sh -o -E '^orange'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "orange"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_orange" | ./your_program.sh -o -E '^orange'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "mango\n!@#$\npear\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] mango
[your_program] pear
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "mango"
[tester::#PZ6] ✓ Found line "pear"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nwolf\nitaly\nfox\nspain" | ./your_program.sh -E '(wolf|fox)'
[your_program] wolf
[your_program] fox
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "wolf"
[tester::#PZ6] ✓ Found line "fox"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(wolf|fox)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 blackberry\nINVALID\nLOG 20 carrot\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (blackberry|carrot)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 blackberry
[your_program] LOG 20 carrot
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 blackberry"
[tester::#PZ6] ✓ Found line "LOG 20 carrot"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "banana_suffix" | ./your_program.sh -E '^banana'
[your_program] banana_suffix
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_banana" | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "btest" | ./your_program.sh -E '[blueberry]'
[your_program] Logs from your program will appear here
[your_program] btest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "btest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] a cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'grape_blueberry' | ./your_program.sh -E 'blueberry$'
[your_program] grape_blueberry
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'blueberry_grape' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[your_program] raspberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'raspberry_raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'grape_strawberry' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[your_program] grape_strawberry
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'strawberry_grape' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] sally has 3 apples
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'g' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[your_program] g
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'gbc' | ./your_program.sh -E '[orange]'
[your_program] gbc
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'pineapple' | ./your_program.sh -E '[bcdfghjkm]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'raspberry' | ./your_program.sh -E '\w'
[your_program] raspberry
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'APPLE' | ./your_program.sh -E '\w'
[your_program] APPLE
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '612' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 612
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷%+_#%-' | ./your_program.sh -E '\w'
[your_program] ÷%+_#%-
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%-#+÷×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] 123
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] dog
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Search multiple files

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 15.9 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "mango" > "fruits-2866.txt"
[tester::#IS6] [setup] echo "strawberry" >> "fruits-2866.txt"
[tester::#IS6] [setup] echo "cabbage" > "vegetables-7978.txt"
[tester::#IS6] [setup] echo "pea" >> "vegetables-7978.txt"
[tester::#IS6] $ ./your_program.sh -E ma.+$ fruits-2866.txt vegetables-7978.txt
[your_program] Logs from your program will appear here
[your_program] fruits-2866.txt:mango
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_cabbage fruits-2866.txt vegetables-7978.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E cabbage fruits-2866.txt vegetables-7978.txt
[your_program] vegetables-7978.txt:cabbage
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "orange" > "fruits-7694.txt"
[tester::#OL9] [setup] echo "grape" >> "fruits-7694.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-7694.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-7694.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-7694.txt
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_pea fruits-7694.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E orange fruits-7694.txt
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "orange" > "fruits-1929.txt"
[tester::#DR5] $ ./your_program.sh -E ora.+ fruits-1929.txt
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_orange fruits-1929.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+nge fruits-1929.txt
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like pineapple\nnothing here\nbanana and pineapple are tasty" | ./your_program.sh -o -E '(pineapple|banana)'
[your_program] Logs from your program will appear here
[your_program] pineapple
[your_program] banana
[your_program] pineapple
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "pineapple"
[tester::#BO4] ✓ Found line "banana"
[tester::#BO4] ✓ Found line "pineapple"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 lion and I saw 45 fox.\nNothing interesting today.\nLast week I saw 12 foxs." | ./your_program.sh -o -E 'I saw \d+ (lion|fox)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 lion
[your_program] I saw 45 fox
[your_program] I saw 12 foxs
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 lion"
[tester::#BO4] ✓ Found line "I saw 45 fox"
[tester::#BO4] ✓ Found line "I saw 12 foxs"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "pineapple_lemon_banana" | ./your_program.sh -o -E '(banana|lemon|pineapple)'
[your_program] Logs from your program will appear here
[your_program] pineapple
[your_program] lemon
[your_program] banana
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "pineapple"
[tester::#SS2] ✓ Found line "lemon"
[tester::#SS2] ✓ Found line "banana"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] xx
[your_program] yy
[your_program] zz
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 elephants. Also, I see 4 dogs." | ./your_program.sh -o -E 'I see \d+ (elephant|dog)s?'
[your_program] I see 3 elephants
[your_program] I see 4 dogs
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 elephants"
[tester::#SS2] ✓ Found line "I see 4 dogs"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "strawberry_suffix" | ./your_program.sh -o -E '^strawberry'
[your_program] Logs from your program will appear here
[your_program] strawberry
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "strawberry"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_strawberry" | ./your_program.sh -o -E '^strawberry'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "strawberry\n!@#$\nraspberry\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] strawberry
[your_program] raspberry
[your_program] test123
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "strawberry"
[tester::#PZ6] ✓ Found line "raspberry"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nhorse\nitaly\nelephant\nspain" | ./your_program.sh -E '(horse|elephant)'
[your_program] horse
[your_program] elephant
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "horse"
[tester::#PZ6] ✓ Found line "elephant"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(horse|elephant)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 cherry\nINVALID\nLOG 20 corn\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (cherry|corn)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 cherry
[your_program] LOG 20 corn
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 cherry"
[tester::#PZ6] ✓ Found line "LOG 20 corn"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "pineapple_suffix" | ./your_program.sh -E '^pineapple'
[your_program] pineapple_suffix
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "pineapple_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_pineapple" | ./your_program.sh -E '^pineapple'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "stest" | ./your_program.sh -E '[strawberry]'
[your_program] stest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "stest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] a cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] act
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'grape_blueberry' | ./your_program.sh -E 'blueberry$'
[your_program] grape_blueberry
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'blueberry_grape' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'banana_pear' | ./your_program.sh -E '^banana'
[your_program] banana_pear
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'pear_banana' | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] sally has 3 apples
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 3 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 4 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'r' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] r
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'rcd' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] rcd
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'banana' | ./your_program.sh -E '[cdefgh]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[grape]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'mango' | ./your_program.sh -E '\w'
[your_program] mango
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'ORANGE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] ORANGE
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '852' | ./your_program.sh -E '\w'
[your_program] 852
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=×+_#÷%' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] =×+_#÷%
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-%#×=÷' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Recursive search

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 13.3 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "blackberry" > "dir/fruits-1597.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-1597.txt"
[tester::#YX6] [setup] echo "spinach" > "dir/subdir/vegetables-9962.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-9962.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-9962.txt"
[tester::#YX6] [setup] echo "cabbage" > "dir/vegetables-9530.txt"
[tester::#YX6] [setup] echo "pumpkin" >> "dir/vegetables-9530.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-9530.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-1597.txt:blackberry
[your_program] dir/subdir/vegetables-9962.txt:celery
[your_program] dir/subdir/vegetables-9962.txt:cauliflower
[your_program] dir/vegetables-9530.txt:cucumber
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 4 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-1597.txt:pear
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_blackberry dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "blueberry" > "fruits-2787.txt"
[tester::#IS6] [setup] echo "blackberry" >> "fruits-2787.txt"
[tester::#IS6] [setup] echo "carrot" > "vegetables-6730.txt"
[tester::#IS6] [setup] echo "asparagus" >> "vegetables-6730.txt"
[tester::#IS6] $ ./your_program.sh -E bl.+$ fruits-2787.txt vegetables-6730.txt
[your_program] fruits-2787.txt:blueberry
[your_program] fruits-2787.txt:blackberry
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 2 expected lines
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_carrot fruits-2787.txt vegetables-6730.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E carrot fruits-2787.txt vegetables-6730.txt
[your_program] vegetables-6730.txt:carrot
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "cherry" > "fruits-2602.txt"
[tester::#OL9] [setup] echo "apple" >> "fruits-2602.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-2602.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-2602.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-2602.txt
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_broccoli fruits-2602.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E cherry fruits-2602.txt
[your_program] Logs from your program will appear here
[your_program] cherry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "apple" > "fruits-8018.txt"
[tester::#DR5] $ ./your_program.sh -E ap.+ fruits-8018.txt
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_apple fruits-8018.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+ple fruits-8018.txt
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like blueberry\nnothing here\nmango and blueberry are tasty" | ./your_program.sh -o -E '(blueberry|mango)'
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] mango
[your_program] blueberry
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Found line "mango"
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 horse and I saw 45 rabbit.\nNothing interesting today.\nLast week I saw 12 rabbits." | ./your_program.sh -o -E 'I saw \d+ (horse|rabbit)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 horse
[your_program] I saw 45 rabbit
[your_program] I saw 12 rabbits
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 horse"
[tester::#BO4] ✓ Found line "I saw 45 rabbit"
[tester::#BO4] ✓ Found line "I saw 12 rabbits"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "pineapple_orange_raspberry" | ./your_program.sh -o -E '(raspberry|orange|pineapple)'
[your_program] Logs from your program will appear here
[your_program] pineapple
[your_program] orange
[your_program] raspberry
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "pineapple"
[tester::#SS2] ✓ Found line "orange"
[tester::#SS2] ✓ Found line "raspberry"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] xx
[your_program] yy
[your_program] zz
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 monkeys. Also, I see 4 pandas." | ./your_program.sh -o -E 'I see \d+ (monkey|panda)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 monkeys
[your_program] I see 4 pandas
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 monkeys"
[tester::#SS2] ✓ Found line "I see 4 pandas"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "pear_suffix" | ./your_program.sh -o -E '^pear'
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "pear"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_pear" | ./your_program.sh -o -E '^pear'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "pear\n!@#$\nbanana\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] pear
[your_program] banana
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "pear"
[tester::#PZ6] ✓ Found line "banana"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\ngiraffe\nitaly\ndog\nspain" | ./your_program.sh -E '(giraffe|dog)'
[your_program] giraffe
[your_program] dog
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "giraffe"
[tester::#PZ6] ✓ Found line "dog"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(giraffe|dog)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 orange\nINVALID\nLOG 20 carrot\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (orange|carrot)$'
[your_program] LOG 10 orange
[your_program] LOG 20 carrot
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 orange"
[tester::#PZ6] ✓ Found line "LOG 20 carrot"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "strawberry_suffix" | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[your_program] strawberry_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "strawberry_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_strawberry" | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "ptest" | ./your_program.sh -E '[pear]'
[your_program] ptest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "ptest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 1 cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] goøö0Ogol
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'raspberry_banana' | ./your_program.sh -E 'banana$'
[your_program] Logs from your program will appear here
[your_program] raspberry_banana
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'banana_raspberry' | ./your_program.sh -E 'banana$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'apple' | ./your_program.sh -E '^apple$'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'apple_apple' | ./your_program.sh -E '^apple$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'orange_pineapple' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[your_program] orange_pineapple
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'pineapple_orange' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'a' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[your_program] a
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'abc' | ./your_program.sh -E '[apple]'
[your_program] abc
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'mango' | ./your_program.sh -E '[bcdef]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[grape]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'strawberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] strawberry
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'ORANGE' | ./your_program.sh -E '\w'
[your_program] ORANGE
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '312' | ./your_program.sh -E '\w'
[your_program] 312
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-=#_%+÷' | ./your_program.sh -E '\w'
[your_program] -=#_%+÷
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%-÷#=×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
5️⃣ Quantifiers
Match zero or more times

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 18 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'cherry' | ./your_program.sh -E 'cherry*'
[your_program] Logs from your program will appear here
[your_program] cherry
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'cherr' | ./your_program.sh -E 'cherry*'
[your_program] cherr
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'elephant2fox' | ./your_program.sh -E 'elephant\d*fox'
[your_program] Logs from your program will appear here
[your_program] elephant2fox
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'cauliflower,_fresh' | ./your_program.sh -E 'cauliflower,\w*'
[your_program] Logs from your program will appear here
[your_program] cauliflower,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'foxelephantelephantfox' | ./your_program.sh -E '(elephant|fox)*'
[your_program] foxelephantelephantfox
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 66 cherry' | ./your_program.sh -E '^LOG [FION]* \d+ (cherry|cauliflower)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 66 cherry
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 79 cherry' | ./your_program.sh -E '^LOG [FION]* \d+ (cherry|cauliflower)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "cherry" > "dir/fruits-1514.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-1514.txt"
[tester::#YX6] [setup] echo "cauliflower" > "dir/subdir/vegetables-2056.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-2056.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-2056.txt"
[tester::#YX6] [setup] echo "carrot" > "dir/vegetables-8411.txt"
[tester::#YX6] [setup] echo "cabbage" >> "dir/vegetables-8411.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-8411.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-1514.txt:cherry
[your_program] dir/subdir/vegetables-2056.txt:cauliflower
[your_program] dir/subdir/vegetables-2056.txt:celery
[your_program] dir/subdir/vegetables-2056.txt:cauliflower
[your_program] dir/vegetables-8411.txt:cucumber
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 5 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-1514.txt:pear
[your_program] dir/vegetables-8411.txt:carrot
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 2 expected lines
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_cherry dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "plum" > "fruits-6286.txt"
[tester::#IS6] [setup] echo "blueberry" >> "fruits-6286.txt"
[tester::#IS6] [setup] echo "broccoli" > "vegetables-2138.txt"
[tester::#IS6] [setup] echo "cauliflower" >> "vegetables-2138.txt"
[tester::#IS6] $ ./your_program.sh -E pl.+$ fruits-6286.txt vegetables-2138.txt
[your_program] Logs from your program will appear here
[your_program] fruits-6286.txt:plum
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_broccoli fruits-6286.txt vegetables-2138.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E broccoli fruits-6286.txt vegetables-2138.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-2138.txt:broccoli
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "mango" > "fruits-1609.txt"
[tester::#OL9] [setup] echo "watermelon" >> "fruits-1609.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-1609.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-1609.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-1609.txt
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_lettuce fruits-1609.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E mango fruits-1609.txt
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "blueberry" > "fruits-9208.txt"
[tester::#DR5] $ ./your_program.sh -E blue.+ fruits-9208.txt
[your_program] Logs from your program will appear here
[your_program] blueberry
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_blueberry fruits-9208.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+berry fruits-9208.txt
[your_program] Logs from your program will appear here
[your_program] blueberry
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like mango\nnothing here\nblueberry and mango are tasty" | ./your_program.sh -o -E '(mango|blueberry)'
[your_program] Logs from your program will appear here
[your_program] mango
[your_program] blueberry
[your_program] mango
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "mango"
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Found line "mango"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 dog and I saw 45 zebra.\nNothing interesting today.\nLast week I saw 12 zebras." | ./your_program.sh -o -E 'I saw \d+ (dog|zebra)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 dog
[your_program] I saw 45 zebra
[your_program] I saw 12 zebras
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 dog"
[tester::#BO4] ✓ Found line "I saw 45 zebra"
[tester::#BO4] ✓ Found line "I saw 12 zebras"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "pear_banana_lemon" | ./your_program.sh -o -E '(lemon|banana|pear)'
[your_program] Logs from your program will appear here
[your_program] pear
[your_program] banana
[your_program] lemon
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "pear"
[tester::#SS2] ✓ Found line "banana"
[tester::#SS2] ✓ Found line "lemon"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] xx
[your_program] yy
[your_program] zz
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 dogs. Also, I see 4 giraffes." | ./your_program.sh -o -E 'I see \d+ (dog|giraffe)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 dogs
[your_program] I see 4 giraffes
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 dogs"
[tester::#SS2] ✓ Found line "I see 4 giraffes"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "pineapple_suffix" | ./your_program.sh -o -E '^pineapple'
[your_program] Logs from your program will appear here
[your_program] pineapple
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "pineapple"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_pineapple" | ./your_program.sh -o -E '^pineapple'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "pineapple\n!@#$\nstrawberry\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] pineapple
[your_program] strawberry
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "pineapple"
[tester::#PZ6] ✓ Found line "strawberry"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nwolf\nitaly\ndog\nspain" | ./your_program.sh -E '(wolf|dog)'
[your_program] Logs from your program will appear here
[your_program] wolf
[your_program] dog
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "wolf"
[tester::#PZ6] ✓ Found line "dog"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(wolf|dog)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 apple\nINVALID\nLOG 20 lettuce\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (apple|lettuce)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 apple
[your_program] LOG 20 lettuce
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 apple"
[tester::#PZ6] ✓ Found line "LOG 20 lettuce"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "banana_suffix" | ./your_program.sh -E '^banana'
[your_program] banana_suffix
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_banana" | ./your_program.sh -E '^banana'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "btest" | ./your_program.sh -E '[blackberry]'
[your_program] Logs from your program will appear here
[your_program] btest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "btest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'strawberry_orange' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[your_program] strawberry_orange
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_strawberry' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'pineapple' | ./your_program.sh -E '^pineapple$'
[your_program] Logs from your program will appear here
[your_program] pineapple
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pineapple_pineapple' | ./your_program.sh -E '^pineapple$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'raspberry_pineapple' | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[your_program] raspberry_pineapple
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'pineapple_raspberry' | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] sally has 3 apples
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'y' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] y
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'ycd' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] ycd
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'pear' | ./your_program.sh -E '[bcdf]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[mango]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'banana' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] banana
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'STRAWBERRY' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] STRAWBERRY
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '977' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 977
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '×=%_÷=×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] ×=%_÷=×
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%+=-÷×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Match exactly n times

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 17.4 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'bananaaa' | ./your_program.sh -E 'bananaa{2}'
[your_program] Logs from your program will appear here
[your_program] bananaaa
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'fox170' | ./your_program.sh -E 'fox\d{3}'
[your_program] Logs from your program will appear here
[your_program] fox170
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'lettuce,_hi' | ./your_program.sh -E 'lettuce,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'monkeyfox' | ./your_program.sh -E '(fox|monkey){2}'
[your_program] Logs from your program will appear here
[your_program] monkeyfox
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'bananauoi' | ./your_program.sh -E 'banana[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] bananauoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2020-09-07 04:33 banana' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (banana|lettuce)$'
[your_program] Logs from your program will appear here
[your_program] 2020-09-07 04:33 banana
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2022-4-7 4:37 banana' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (banana|lettuce)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'blackberry' | ./your_program.sh -E 'blackberry*'
[your_program] Logs from your program will appear here
[your_program] blackberry
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'blackberr' | ./your_program.sh -E 'blackberry*'
[your_program] Logs from your program will appear here
[your_program] blackberr
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'lion59wolf' | ./your_program.sh -E 'lion\d*wolf'
[your_program] Logs from your program will appear here
[your_program] lion59wolf
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'broccoli,_fresh' | ./your_program.sh -E 'broccoli,\w*'
[your_program] Logs from your program will appear here
[your_program] broccoli,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'wolflionlionwolf' | ./your_program.sh -E '(lion|wolf)*'
[your_program] wolflionlionwolf
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 39 blackberry' | ./your_program.sh -E '^LOG [FION]* \d+ (blackberry|broccoli)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 39 blackberry
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 42 blackberry' | ./your_program.sh -E '^LOG [FION]* \d+ (blackberry|broccoli)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "cherry" > "dir/fruits-7623.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-7623.txt"
[tester::#YX6] [setup] echo "tomato" > "dir/subdir/vegetables-3821.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-3821.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-3821.txt"
[tester::#YX6] [setup] echo "broccoli" > "dir/vegetables-5261.txt"
[tester::#YX6] [setup] echo "carrot" >> "dir/vegetables-5261.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-5261.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/subdir/vegetables-3821.txt:celery
[your_program] dir/subdir/vegetables-3821.txt:cauliflower
[your_program] dir/vegetables-5261.txt:cucumber
[your_program] dir/fruits-7623.txt:cherry
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 4 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/vegetables-5261.txt:carrot
[your_program] dir/fruits-7623.txt:pear
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 2 expected lines
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_cherry dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "apple" > "fruits-9719.txt"
[tester::#IS6] [setup] echo "cherry" >> "fruits-9719.txt"
[tester::#IS6] [setup] echo "lettuce" > "vegetables-1001.txt"
[tester::#IS6] [setup] echo "cabbage" >> "vegetables-1001.txt"
[tester::#IS6] $ ./your_program.sh -E ap.+$ fruits-9719.txt vegetables-1001.txt
[your_program] Logs from your program will appear here
[your_program] fruits-9719.txt:apple
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_lettuce fruits-9719.txt vegetables-1001.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E lettuce fruits-9719.txt vegetables-1001.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-1001.txt:lettuce
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "lemon" > "fruits-2053.txt"
[tester::#OL9] [setup] echo "orange" >> "fruits-2053.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-2053.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-2053.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-2053.txt
[your_program] blueberry
[your_program] strawberry
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_corn fruits-2053.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E lemon fruits-2053.txt
[your_program] Logs from your program will appear here
[your_program] lemon
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "plum" > "fruits-9478.txt"
[tester::#DR5] $ ./your_program.sh -E pl.+ fruits-9478.txt
[your_program] Logs from your program will appear here
[your_program] plum
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_plum fruits-9478.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+um fruits-9478.txt
[your_program] plum
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like apple\nnothing here\nblueberry and apple are tasty" | ./your_program.sh -o -E '(apple|blueberry)'
[your_program] Logs from your program will appear here
[your_program] apple
[your_program] blueberry
[your_program] apple
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "apple"
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Found line "apple"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 monkey and I saw 45 dog.\nNothing interesting today.\nLast week I saw 12 dogs." | ./your_program.sh -o -E 'I saw \d+ (monkey|dog)s?'
[your_program] I saw 3 monkey
[your_program] I saw 45 dog
[your_program] I saw 12 dogs
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 monkey"
[tester::#BO4] ✓ Found line "I saw 45 dog"
[tester::#BO4] ✓ Found line "I saw 12 dogs"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "blackberry_grape_raspberry" | ./your_program.sh -o -E '(raspberry|grape|blackberry)'
[your_program] blackberry
[your_program] grape
[your_program] raspberry
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "blackberry"
[tester::#SS2] ✓ Found line "grape"
[tester::#SS2] ✓ Found line "raspberry"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] xx
[your_program] yy
[your_program] zz
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 tigers. Also, I see 4 horses." | ./your_program.sh -o -E 'I see \d+ (tiger|horse)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 tigers
[your_program] I see 4 horses
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 tigers"
[tester::#SS2] ✓ Found line "I see 4 horses"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "orange_suffix" | ./your_program.sh -o -E '^orange'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "orange"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_orange" | ./your_program.sh -o -E '^orange'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "strawberry\n!@#$\npear\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] pear
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "strawberry"
[tester::#PZ6] ✓ Found line "pear"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nwolf\nitaly\ndog\nspain" | ./your_program.sh -E '(wolf|dog)'
[your_program] Logs from your program will appear here
[your_program] wolf
[your_program] dog
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "wolf"
[tester::#PZ6] ✓ Found line "dog"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(wolf|dog)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 mango\nINVALID\nLOG 20 spinach\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (mango|spinach)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 mango
[your_program] LOG 20 spinach
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 mango"
[tester::#PZ6] ✓ Found line "LOG 20 spinach"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "orange_suffix" | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[your_program] orange_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "orange_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_orange" | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "ctest" | ./your_program.sh -E '[cherry]'
[your_program] Logs from your program will appear here
[your_program] ctest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "ctest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] caaats
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'grape_blueberry' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[your_program] grape_blueberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'blueberry_grape' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pear_pear' | ./your_program.sh -E '^pear$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'orange_raspberry' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[your_program] orange_raspberry
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'raspberry_orange' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'l' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[your_program] l
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'lbc' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[your_program] lbc
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'raspberry' | ./your_program.sh -E '[cdfghijkl]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'banana' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] banana
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'MANGO' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] MANGO
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '881' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 881
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#=-_÷%+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] #=-_÷%+
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-#+÷%×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Match at least n times

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 19.6 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'mangooo' | ./your_program.sh -E 'mangoo{2,}'
[your_program] Logs from your program will appear here
[your_program] mangooo
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'mangoooo' | ./your_program.sh -E 'mangoo{2,}'
[your_program] Logs from your program will appear here
[your_program] mangoooo
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'wolf3670' | ./your_program.sh -E 'wolf\d{3,}'
[your_program] wolf3670
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'cauliflower,_tag' | ./your_program.sh -E 'cauliflower,\w{2,}'
[your_program] Logs from your program will appear here
[your_program] cauliflower,_tag
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'onioncauliflowerzucchinionion' | ./your_program.sh -E '(cauliflower|zucchini|onion){3,}'
[your_program] Logs from your program will appear here
[your_program] onioncauliflowerzucchinionion
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '09:25 LOG INFO token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 09:25 LOG INFO token_created
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '09:38 LOG OK device_registered' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'cherryyy' | ./your_program.sh -E 'cherryy{2}'
[your_program] Logs from your program will appear here
[your_program] cherryyy
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'lion453' | ./your_program.sh -E 'lion\d{3}'
[your_program] lion453
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'pea,_hi' | ./your_program.sh -E 'pea,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'pandalion' | ./your_program.sh -E '(lion|panda){2}'
[your_program] pandalion
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'cherryuoi' | ./your_program.sh -E 'cherry[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] cherryuoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2024-05-06 11:42 cherry' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (cherry|pea)$'
[your_program] Logs from your program will appear here
[your_program] 2024-05-06 11:42 cherry
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2024-5-7 10:33 cherry' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (cherry|pea)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'grape' | ./your_program.sh -E 'grape*'
[your_program] grape
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'grap' | ./your_program.sh -E 'grape*'
[your_program] grap
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'panda70giraffe' | ./your_program.sh -E 'panda\d*giraffe'
[your_program] Logs from your program will appear here
[your_program] panda70giraffe
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'potato,_fresh' | ./your_program.sh -E 'potato,\w*'
[your_program] potato,_fresh
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'giraffepandapandagiraffe' | ./your_program.sh -E '(panda|giraffe)*'
[your_program] Logs from your program will appear here
[your_program] giraffepandapandagiraffe
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 72 grape' | ./your_program.sh -E '^LOG [FION]* \d+ (grape|potato)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 72 grape
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 81 grape' | ./your_program.sh -E '^LOG [FION]* \d+ (grape|potato)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "plum" > "dir/fruits-8694.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-8694.txt"
[tester::#YX6] [setup] echo "zucchini" > "dir/subdir/vegetables-4953.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-4953.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-4953.txt"
[tester::#YX6] [setup] echo "zucchini" > "dir/vegetables-3882.txt"
[tester::#YX6] [setup] echo "spinach" >> "dir/vegetables-3882.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-3882.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/vegetables-3882.txt:cucumber
[your_program] dir/subdir/vegetables-4953.txt:celery
[your_program] dir/subdir/vegetables-4953.txt:cauliflower
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 3 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] dir/fruits-8694.txt:pear
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_plum dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "cherry" > "fruits-6653.txt"
[tester::#IS6] [setup] echo "strawberry" >> "fruits-6653.txt"
[tester::#IS6] [setup] echo "lettuce" > "vegetables-6411.txt"
[tester::#IS6] [setup] echo "broccoli" >> "vegetables-6411.txt"
[tester::#IS6] $ ./your_program.sh -E ch.+$ fruits-6653.txt vegetables-6411.txt
[your_program] fruits-6653.txt:cherry
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_lettuce fruits-6653.txt vegetables-6411.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E lettuce fruits-6653.txt vegetables-6411.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-6411.txt:lettuce
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "mango" > "fruits-6020.txt"
[tester::#OL9] [setup] echo "grape" >> "fruits-6020.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-6020.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-6020.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-6020.txt
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_tomato fruits-6020.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E mango fruits-6020.txt
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "plum" > "fruits-6536.txt"
[tester::#DR5] $ ./your_program.sh -E pl.+ fruits-6536.txt
[your_program] Logs from your program will appear here
[your_program] plum
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_plum fruits-6536.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+um fruits-6536.txt
[your_program] Logs from your program will appear here
[your_program] plum
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like banana\nnothing here\ngrape and banana are tasty" | ./your_program.sh -o -E '(banana|grape)'
[your_program] banana
[your_program] grape
[your_program] banana
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "banana"
[tester::#BO4] ✓ Found line "grape"
[tester::#BO4] ✓ Found line "banana"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 elephant and I saw 45 panda.\nNothing interesting today.\nLast week I saw 12 pandas." | ./your_program.sh -o -E 'I saw \d+ (elephant|panda)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 elephant
[your_program] I saw 45 panda
[your_program] I saw 12 pandas
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 elephant"
[tester::#BO4] ✓ Found line "I saw 45 panda"
[tester::#BO4] ✓ Found line "I saw 12 pandas"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "orange_watermelon_grape" | ./your_program.sh -o -E '(grape|watermelon|orange)'
[your_program] Logs from your program will appear here
[your_program] orange
[your_program] watermelon
[your_program] grape
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "orange"
[tester::#SS2] ✓ Found line "watermelon"
[tester::#SS2] ✓ Found line "grape"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 dogs. Also, I see 4 zebras." | ./your_program.sh -o -E 'I see \d+ (dog|zebra)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 dogs
[your_program] I see 4 zebras
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 dogs"
[tester::#SS2] ✓ Found line "I see 4 zebras"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "mango_suffix" | ./your_program.sh -o -E '^mango'
[your_program] mango
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "mango"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_mango" | ./your_program.sh -o -E '^mango'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "pear\n!@#$\nraspberry\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] pear
[your_program] raspberry
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "pear"
[tester::#PZ6] ✓ Found line "raspberry"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nfox\nitaly\nlion\nspain" | ./your_program.sh -E '(fox|lion)'
[your_program] Logs from your program will appear here
[your_program] fox
[your_program] lion
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "fox"
[tester::#PZ6] ✓ Found line "lion"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(fox|lion)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 lemon\nINVALID\nLOG 20 corn\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (lemon|corn)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 lemon
[your_program] LOG 20 corn
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 lemon"
[tester::#PZ6] ✓ Found line "LOG 20 corn"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "blueberry_suffix" | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[your_program] blueberry_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "blueberry_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_blueberry" | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "wtest" | ./your_program.sh -E '[watermelon]'
[your_program] Logs from your program will appear here
[your_program] wtest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "wtest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] caaats
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'banana_blueberry' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[your_program] banana_blueberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'blueberry_banana' | ./your_program.sh -E 'blueberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'grape' | ./your_program.sh -E '^grape$'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'grape_grape' | ./your_program.sh -E '^grape$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'apple_raspberry' | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[your_program] apple_raspberry
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'raspberry_apple' | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] sally has 124 apples
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 4 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'r' | ./your_program.sh -E '[orange]'
[your_program] r
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'rbc' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[your_program] rbc
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'raspberry' | ./your_program.sh -E '[cdfghijkl]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'blueberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] blueberry
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'BANANA' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] BANANA
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '590' | ./your_program.sh -E '\w'
[your_program] 590
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#-÷_-+÷' | ./your_program.sh -E '\w'
[your_program] #-÷_-+÷
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '×÷+-=%' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Match between n and m times

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 15.6 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'asparaguss_soup' | ./your_program.sh -E 'asparagus{2,4}_soup'
[your_program] Logs from your program will appear here
[your_program] asparaguss_soup
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'asparagus_soup' | ./your_program.sh -E 'asparagus{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'asparagusssss_soup' | ./your_program.sh -E 'asparagus{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'giraffe819' | ./your_program.sh -E 'giraffe\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] giraffe819
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'grape,_ab' | ./your_program.sh -E 'grape,\w{1,3}'
[your_program] Logs from your program will appear here
[your_program] grape,_ab
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'zebragiraffehorse' | ./your_program.sh -E '(giraffe|horse|zebra){2,3}'
[your_program] Logs from your program will appear here
[your_program] zebragiraffehorse
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'bananaaei' | ./your_program.sh -E 'banana[aeiou]{2,4}'
[your_program] bananaaei
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2023-11-8 22:10 LOG DEBUG token_created' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[your_program] 2023-11-8 22:10 LOG DEBUG token_created
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '21:17:21:2 WARN INFO token_created' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'mangooo' | ./your_program.sh -E 'mangoo{2,}'
[your_program] Logs from your program will appear here
[your_program] mangooo
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'mangooooo' | ./your_program.sh -E 'mangoo{2,}'
[your_program] mangooooo
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'fox9288' | ./your_program.sh -E 'fox\d{3,}'
[your_program] fox9288
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'broccoli,_tag' | ./your_program.sh -E 'broccoli,\w{2,}'
[your_program] broccoli,_tag
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'carrotbroccolicorncarrot' | ./your_program.sh -E '(broccoli|corn|carrot){3,}'
[your_program] carrotbroccolicorncarrot
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '12:48 LOG WARN device_registered' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 12:48 LOG WARN device_registered
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '01:56 LOG OK token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'lemonnn' | ./your_program.sh -E 'lemonn{2}'
[your_program] lemonnn
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'horse950' | ./your_program.sh -E 'horse\d{3}'
[your_program] Logs from your program will appear here
[your_program] horse950
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'broccoli,_hi' | ./your_program.sh -E 'broccoli,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'wolfhorse' | ./your_program.sh -E '(horse|wolf){2}'
[your_program] wolfhorse
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'lemonuoi' | ./your_program.sh -E 'lemon[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] lemonuoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2021-07-22 03:58 lemon' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (lemon|broccoli)$'
[your_program] Logs from your program will appear here
[your_program] 2021-07-22 03:58 lemon
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2024-9-6 6:20 lemon' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (lemon|broccoli)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'pear' | ./your_program.sh -E 'pear*'
[your_program] pear
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'pea' | ./your_program.sh -E 'pear*'
[your_program] pea
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'fox73rabbit' | ./your_program.sh -E 'fox\d*rabbit'
[your_program] Logs from your program will appear here
[your_program] fox73rabbit
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'corn,_fresh' | ./your_program.sh -E 'corn,\w*'
[your_program] Logs from your program will appear here
[your_program] corn,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'rabbitfoxfoxrabbit' | ./your_program.sh -E '(fox|rabbit)*'
[your_program] Logs from your program will appear here
[your_program] rabbitfoxfoxrabbit
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 43 pear' | ./your_program.sh -E '^LOG [FION]* \d+ (pear|corn)$'
[your_program] LOG INFO 43 pear
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 80 pear' | ./your_program.sh -E '^LOG [FION]* \d+ (pear|corn)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "raspberry" > "dir/fruits-4389.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-4389.txt"
[tester::#YX6] [setup] echo "onion" > "dir/subdir/vegetables-4360.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-4360.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-4360.txt"
[tester::#YX6] [setup] echo "cauliflower" > "dir/vegetables-4104.txt"
[tester::#YX6] [setup] echo "pumpkin" >> "dir/vegetables-4104.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-4104.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] dir/fruits-4389.txt:raspberry
[your_program] Logs from your program will appear here
[your_program] dir/vegetables-4104.txt:cauliflower
[your_program] dir/vegetables-4104.txt:cucumber
[your_program] dir/subdir/vegetables-4360.txt:celery
[your_program] dir/subdir/vegetables-4360.txt:cauliflower
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 5 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] dir/fruits-4389.txt:pear
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_raspberry dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "apple" > "fruits-2831.txt"
[tester::#IS6] [setup] echo "blueberry" >> "fruits-2831.txt"
[tester::#IS6] [setup] echo "corn" > "vegetables-7742.txt"
[tester::#IS6] [setup] echo "tomato" >> "vegetables-7742.txt"
[tester::#IS6] $ ./your_program.sh -E ap.+$ fruits-2831.txt vegetables-7742.txt
[your_program] Logs from your program will appear here
[your_program] fruits-2831.txt:apple
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_corn fruits-2831.txt vegetables-7742.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E corn fruits-2831.txt vegetables-7742.txt
[your_program] vegetables-7742.txt:corn
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "orange" > "fruits-2893.txt"
[tester::#OL9] [setup] echo "raspberry" >> "fruits-2893.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-2893.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-2893.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-2893.txt
[your_program] raspberry
[your_program] blueberry
[your_program] strawberry
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 3 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_tomato fruits-2893.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E orange fruits-2893.txt
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "banana" > "fruits-5387.txt"
[tester::#DR5] $ ./your_program.sh -E ban.+ fruits-5387.txt
[your_program] Logs from your program will appear here
[your_program] banana
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_banana fruits-5387.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+ana fruits-5387.txt
[your_program] Logs from your program will appear here
[your_program] banana
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like watermelon\nnothing here\nmango and watermelon are tasty" | ./your_program.sh -o -E '(watermelon|mango)'
[your_program] watermelon
[your_program] Logs from your program will appear here
[your_program] mango
[your_program] watermelon
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "watermelon"
[tester::#BO4] ✓ Found line "mango"
[tester::#BO4] ✓ Found line "watermelon"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 tiger and I saw 45 fox.\nNothing interesting today.\nLast week I saw 12 foxs." | ./your_program.sh -o -E 'I saw \d+ (tiger|fox)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 tiger
[your_program] I saw 45 fox
[your_program] I saw 12 foxs
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 tiger"
[tester::#BO4] ✓ Found line "I saw 45 fox"
[tester::#BO4] ✓ Found line "I saw 12 foxs"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "strawberry_blackberry_raspberry" | ./your_program.sh -o -E '(raspberry|blackberry|strawberry)'
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] blackberry
[your_program] raspberry
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "strawberry"
[tester::#SS2] ✓ Found line "blackberry"
[tester::#SS2] ✓ Found line "raspberry"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 dogs. Also, I see 4 elephants." | ./your_program.sh -o -E 'I see \d+ (dog|elephant)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 dogs
[your_program] I see 4 elephants
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 dogs"
[tester::#SS2] ✓ Found line "I see 4 elephants"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "pear_suffix" | ./your_program.sh -o -E '^pear'
[your_program] pear
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "pear"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_pear" | ./your_program.sh -o -E '^pear'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "orange\n!@#$\ngrape\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] orange
[your_program] grape
[your_program] Logs from your program will appear here
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "orange"
[tester::#PZ6] ✓ Found line "grape"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nwolf\nitaly\nlion\nspain" | ./your_program.sh -E '(wolf|lion)'
[your_program] wolf
[your_program] lion
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "wolf"
[tester::#PZ6] ✓ Found line "lion"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(wolf|lion)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 blueberry\nINVALID\nLOG 20 cabbage\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (blueberry|cabbage)$'
[your_program] LOG 10 blueberry
[your_program] LOG 20 cabbage
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 blueberry"
[tester::#PZ6] ✓ Found line "LOG 20 cabbage"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "pear_suffix" | ./your_program.sh -E '^pear'
[your_program] Logs from your program will appear here
[your_program] pear_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "pear_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_pear" | ./your_program.sh -E '^pear'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "ptest" | ./your_program.sh -E '[pineapple]'
[your_program] ptest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "ptest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] a cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 1 cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'grape_strawberry' | ./your_program.sh -E 'strawberry$'
[your_program] Logs from your program will appear here
[your_program] grape_strawberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'strawberry_grape' | ./your_program.sh -E 'strawberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_orange' | ./your_program.sh -E '^orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'raspberry_apple' | ./your_program.sh -E '^raspberry'
[your_program] raspberry_apple
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'apple_raspberry' | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'a' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[your_program] a
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'abc' | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[your_program] abc
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'mango' | ./your_program.sh -E '[bcdef]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pineapple' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] pineapple
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'BANANA' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] BANANA
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '508' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 508
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-+=_÷×%' | ./your_program.sh -E '\w'
[your_program] -+=_÷×%
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '+-%÷#×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
6️⃣ Backreferences
Single Backreference

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 17.1 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#SB5] Running tests for Stage #SB5 (Backreferences - Single Backreference)
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(cat) and \1'
[your_program] cat and cat
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat is cat, not dog' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] cat is cat, not dog
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat is c@t, not d0g' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] Test passed.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'zucchiniii_soup' | ./your_program.sh -E 'zucchini{2,4}_soup'
[your_program] Logs from your program will appear here
[your_program] zucchiniii_soup
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'zucchini_soup' | ./your_program.sh -E 'zucchini{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'zucchiniiiii_soup' | ./your_program.sh -E 'zucchini{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'giraffe963' | ./your_program.sh -E 'giraffe\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] giraffe963
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'cherry,_ab' | ./your_program.sh -E 'cherry,\w{1,3}'
[your_program] cherry,_ab
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'monkeygiraffezebra' | ./your_program.sh -E '(giraffe|zebra|monkey){2,3}'
[your_program] Logs from your program will appear here
[your_program] monkeygiraffezebra
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'bananaaei' | ./your_program.sh -E 'banana[aeiou]{2,4}'
[your_program] Logs from your program will appear here
[your_program] bananaaei
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2028-2-14 3:37 LOG INFO session_validated' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[your_program] 2028-2-14 3:37 LOG INFO session_validated
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '3:32:26:6 WARN INFO token_created' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'cherryyy' | ./your_program.sh -E 'cherryy{2,}'
[your_program] Logs from your program will appear here
[your_program] cherryyy
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'cherryyyy' | ./your_program.sh -E 'cherryy{2,}'
[your_program] Logs from your program will appear here
[your_program] cherryyyy
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'monkey8022' | ./your_program.sh -E 'monkey\d{3,}'
[your_program] Logs from your program will appear here
[your_program] monkey8022
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'carrot,_tag' | ./your_program.sh -E 'carrot,\w{2,}'
[your_program] Logs from your program will appear here
[your_program] carrot,_tag
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'lettucecarrotpumpkinlettuce' | ./your_program.sh -E '(carrot|pumpkin|lettuce){3,}'
[your_program] Logs from your program will appear here
[your_program] lettucecarrotpumpkinlettuce
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '07:41 LOG INFO session_validated' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] 07:41 LOG INFO session_validated
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '12:29 LOG OK token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'bananaaa' | ./your_program.sh -E 'bananaa{2}'
[your_program] Logs from your program will appear here
[your_program] bananaaa
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'elephant567' | ./your_program.sh -E 'elephant\d{3}'
[your_program] Logs from your program will appear here
[your_program] elephant567
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'cauliflower,_hi' | ./your_program.sh -E 'cauliflower,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'catelephant' | ./your_program.sh -E '(elephant|cat){2}'
[your_program] Logs from your program will appear here
[your_program] catelephant
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'bananauoi' | ./your_program.sh -E 'banana[aeiou]{3}'
[your_program] bananauoi
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2021-08-05 22:20 banana' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (banana|cauliflower)$'
[your_program] Logs from your program will appear here
[your_program] 2021-08-05 22:20 banana
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2024-2-7 7:47 banana' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (banana|cauliflower)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'lemon' | ./your_program.sh -E 'lemon*'
[your_program] lemon
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'lemo' | ./your_program.sh -E 'lemon*'
[your_program] Logs from your program will appear here
[your_program] lemo
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'giraffe21wolf' | ./your_program.sh -E 'giraffe\d*wolf'
[your_program] Logs from your program will appear here
[your_program] giraffe21wolf
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'broccoli,_fresh' | ./your_program.sh -E 'broccoli,\w*'
[your_program] Logs from your program will appear here
[your_program] broccoli,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'wolfgiraffegiraffewolf' | ./your_program.sh -E '(giraffe|wolf)*'
[your_program] Logs from your program will appear here
[your_program] wolfgiraffegiraffewolf
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 78 lemon' | ./your_program.sh -E '^LOG [FION]* \d+ (lemon|broccoli)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 78 lemon
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 25 lemon' | ./your_program.sh -E '^LOG [FION]* \d+ (lemon|broccoli)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "orange" > "dir/fruits-4579.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-4579.txt"
[tester::#YX6] [setup] echo "potato" > "dir/subdir/vegetables-9057.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-9057.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-9057.txt"
[tester::#YX6] [setup] echo "broccoli" > "dir/vegetables-8120.txt"
[tester::#YX6] [setup] echo "onion" >> "dir/vegetables-8120.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-8120.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/vegetables-8120.txt:cucumber
[your_program] dir/subdir/vegetables-9057.txt:celery
[your_program] dir/subdir/vegetables-9057.txt:cauliflower
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 3 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-4579.txt:pear
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_orange dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "blueberry" > "fruits-6343.txt"
[tester::#IS6] [setup] echo "pineapple" >> "fruits-6343.txt"
[tester::#IS6] [setup] echo "pea" > "vegetables-6809.txt"
[tester::#IS6] [setup] echo "broccoli" >> "vegetables-6809.txt"
[tester::#IS6] $ ./your_program.sh -E bl.+$ fruits-6343.txt vegetables-6809.txt
[your_program] Logs from your program will appear here
[your_program] fruits-6343.txt:blueberry
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_pea fruits-6343.txt vegetables-6809.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E pea fruits-6343.txt vegetables-6809.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-6809.txt:pea
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "blackberry" > "fruits-9294.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-9294.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-9294.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-9294.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-9294.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[your_program] blueberry
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 4 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_corn fruits-9294.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E blackberry fruits-9294.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "mango" > "fruits-6329.txt"
[tester::#DR5] $ ./your_program.sh -E ma.+ fruits-6329.txt
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_mango fruits-6329.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+ngo fruits-6329.txt
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like pear\nnothing here\napple and pear are tasty" | ./your_program.sh -o -E '(pear|apple)'
[your_program] Logs from your program will appear here
[your_program] pear
[your_program] apple
[your_program] pear
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "pear"
[tester::#BO4] ✓ Found line "apple"
[tester::#BO4] ✓ Found line "pear"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 lion and I saw 45 rabbit.\nNothing interesting today.\nLast week I saw 12 rabbits." | ./your_program.sh -o -E 'I saw \d+ (lion|rabbit)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 lion
[your_program] I saw 45 rabbit
[your_program] I saw 12 rabbits
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 lion"
[tester::#BO4] ✓ Found line "I saw 45 rabbit"
[tester::#BO4] ✓ Found line "I saw 12 rabbits"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "strawberry_banana_pear" | ./your_program.sh -o -E '(pear|banana|strawberry)'
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] banana
[your_program] pear
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "strawberry"
[tester::#SS2] ✓ Found line "banana"
[tester::#SS2] ✓ Found line "pear"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 pandas. Also, I see 4 lions." | ./your_program.sh -o -E 'I see \d+ (panda|lion)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 pandas
[your_program] I see 4 lions
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 pandas"
[tester::#SS2] ✓ Found line "I see 4 lions"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "apple_suffix" | ./your_program.sh -o -E '^apple'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "apple"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_apple" | ./your_program.sh -o -E '^apple'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "mango\n!@#$\nraspberry\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] mango
[your_program] raspberry
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "mango"
[tester::#PZ6] ✓ Found line "raspberry"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\ndog\nitaly\nwolf\nspain" | ./your_program.sh -E '(dog|wolf)'
[your_program] Logs from your program will appear here
[your_program] dog
[your_program] wolf
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "dog"
[tester::#PZ6] ✓ Found line "wolf"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(dog|wolf)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 blueberry\nINVALID\nLOG 20 onion\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (blueberry|onion)$'
[your_program] LOG 10 blueberry
[your_program] Logs from your program will appear here
[your_program] LOG 20 onion
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 blueberry"
[tester::#PZ6] ✓ Found line "LOG 20 onion"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "raspberry_suffix" | ./your_program.sh -E '^raspberry'
[your_program] raspberry_suffix
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "raspberry_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_raspberry" | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "atest" | ./your_program.sh -E '[apple]'
[your_program] Logs from your program will appear here
[your_program] atest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "atest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] act
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] caaats
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'blueberry_orange' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[your_program] blueberry_orange
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_blueberry' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'grape' | ./your_program.sh -E '^grape$'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'grape_grape' | ./your_program.sh -E '^grape$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'apple_raspberry' | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[your_program] apple_raspberry
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'raspberry_apple' | ./your_program.sh -E '^apple'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'e' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] e
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'ecd' | ./your_program.sh -E '[strawberry]'
[your_program] ecd
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'apple' | ./your_program.sh -E '[bcdfg]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[blueberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'blueberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] blueberry
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'RASPBERRY' | ./your_program.sh -E '\w'
[your_program] RASPBERRY
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '357' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 357
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '+=-_-÷%' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] +=-_-÷%
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '×%#+=-' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] dog
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Multiple Backreferences

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 16.4 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#TG1] Running tests for Stage #TG1 (Backreferences - Multiple Backreferences)
[tester::#TG1] $ echo -n '3 red squares and 3 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[your_program] 3 red squares and 3 red circles
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '3 red squares and 4 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep 101 is doing grep 101 times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '$?! 101 is doing $?! 101 times' | ./your_program.sh -E '(\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep yes is doing grep yes times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'efg-hij is efg-hij, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not xyz' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pie' | ./your_program.sh -E '^(\w+) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[your_program] apple pie, apple and pie
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'pineapple pie, pineapple and pie' | ./your_program.sh -E '^(apple) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pies' | ./your_program.sh -E '^(\w+) (pie), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[your_program] howwdy hey there, howwdy hey
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'hody hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy heeey there, howwdy heeey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'cat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'bat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] Test passed.
[tester::#SB5] Running tests for Stage #SB5 (Backreferences - Single Backreference)
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(\w+) and \1'
[your_program] cat and cat
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat is cat, not dog' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[your_program] cat is cat, not dog
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat is c@t, not d0g' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] Test passed.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'zucchinii_soup' | ./your_program.sh -E 'zucchini{2,4}_soup'
[your_program] zucchinii_soup
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'zucchini_soup' | ./your_program.sh -E 'zucchini{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'zucchiniiiii_soup' | ./your_program.sh -E 'zucchini{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'wolf687' | ./your_program.sh -E 'wolf\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] wolf687
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'grape,_ab' | ./your_program.sh -E 'grape,\w{1,3}'
[your_program] Logs from your program will appear here
[your_program] grape,_ab
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'horsewolfcat' | ./your_program.sh -E '(wolf|cat|horse){2,3}'
[your_program] horsewolfcat
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'mangoaei' | ./your_program.sh -E 'mango[aeiou]{2,4}'
[your_program] mangoaei
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2022-5-15 15:0 LOG DEBUG session_validated' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[your_program] 2022-5-15 15:0 LOG DEBUG session_validated
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '21:50:49:4 WARN INFO device_registered' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'pearrr' | ./your_program.sh -E 'pearr{2,}'
[your_program] pearrr
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'pearrrr' | ./your_program.sh -E 'pearr{2,}'
[your_program] Logs from your program will appear here
[your_program] pearrrr
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'dog7832' | ./your_program.sh -E 'dog\d{3,}'
[your_program] dog7832
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'pea,_tag' | ./your_program.sh -E 'pea,\w{2,}'
[your_program] Logs from your program will appear here
[your_program] pea,_tag
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'cauliflowerpeabroccolicauliflower' | ./your_program.sh -E '(pea|broccoli|cauliflower){3,}'
[your_program] cauliflowerpeabroccolicauliflower
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '20:53 LOG DEBUG device_registered' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 20:53 LOG DEBUG device_registered
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '10:08 LOG OK token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'cherryyy' | ./your_program.sh -E 'cherryy{2}'
[your_program] cherryyy
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'lion428' | ./your_program.sh -E 'lion\d{3}'
[your_program] lion428
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'pumpkin,_hi' | ./your_program.sh -E 'pumpkin,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'monkeylion' | ./your_program.sh -E '(lion|monkey){2}'
[your_program] monkeylion
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'cherryuoi' | ./your_program.sh -E 'cherry[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] cherryuoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2021-09-17 16:26 cherry' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (cherry|pumpkin)$'
[your_program] Logs from your program will appear here
[your_program] 2021-09-17 16:26 cherry
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2020-6-6 7:5 cherry' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (cherry|pumpkin)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'watermelon' | ./your_program.sh -E 'watermelon*'
[your_program] Logs from your program will appear here
[your_program] watermelon
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'watermelo' | ./your_program.sh -E 'watermelon*'
[your_program] watermelo
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'monkey21cat' | ./your_program.sh -E 'monkey\d*cat'
[your_program] monkey21cat
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'potato,_fresh' | ./your_program.sh -E 'potato,\w*'
[your_program] Logs from your program will appear here
[your_program] potato,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'catmonkeymonkeycat' | ./your_program.sh -E '(monkey|cat)*'
[your_program] catmonkeymonkeycat
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 27 watermelon' | ./your_program.sh -E '^LOG [FION]* \d+ (watermelon|potato)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 27 watermelon
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 93 watermelon' | ./your_program.sh -E '^LOG [FION]* \d+ (watermelon|potato)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "pineapple" > "dir/fruits-9977.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-9977.txt"
[tester::#YX6] [setup] echo "cauliflower" > "dir/subdir/vegetables-1520.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-1520.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-1520.txt"
[tester::#YX6] [setup] echo "asparagus" > "dir/vegetables-8253.txt"
[tester::#YX6] [setup] echo "potato" >> "dir/vegetables-8253.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-8253.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/subdir/vegetables-1520.txt:cauliflower
[your_program] dir/subdir/vegetables-1520.txt:celery
[your_program] dir/subdir/vegetables-1520.txt:cauliflower
[your_program] dir/vegetables-8253.txt:cucumber
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 4 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-9977.txt:pear
[your_program] dir/vegetables-8253.txt:asparagus
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 2 expected lines
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_pineapple dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "strawberry" > "fruits-7961.txt"
[tester::#IS6] [setup] echo "plum" >> "fruits-7961.txt"
[tester::#IS6] [setup] echo "spinach" > "vegetables-3105.txt"
[tester::#IS6] [setup] echo "pumpkin" >> "vegetables-3105.txt"
[tester::#IS6] $ ./your_program.sh -E st.+$ fruits-7961.txt vegetables-3105.txt
[your_program] Logs from your program will appear here
[your_program] fruits-7961.txt:strawberry
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_spinach fruits-7961.txt vegetables-3105.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E spinach fruits-7961.txt vegetables-3105.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-3105.txt:spinach
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "plum" > "fruits-2070.txt"
[tester::#OL9] [setup] echo "raspberry" >> "fruits-2070.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-2070.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-2070.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-2070.txt
[your_program] raspberry
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 3 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_carrot fruits-2070.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E plum fruits-2070.txt
[your_program] plum
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "blackberry" > "fruits-2233.txt"
[tester::#DR5] $ ./your_program.sh -E black.+ fruits-2233.txt
[your_program] blackberry
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_blackberry fruits-2233.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+berry fruits-2233.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like lemon\nnothing here\nplum and lemon are tasty" | ./your_program.sh -o -E '(lemon|plum)'
[your_program] Logs from your program will appear here
[your_program] lemon
[your_program] plum
[your_program] lemon
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "lemon"
[tester::#BO4] ✓ Found line "plum"
[tester::#BO4] ✓ Found line "lemon"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 zebra and I saw 45 lion.\nNothing interesting today.\nLast week I saw 12 lions." | ./your_program.sh -o -E 'I saw \d+ (zebra|lion)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 zebra
[your_program] I saw 45 lion
[your_program] I saw 12 lions
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 zebra"
[tester::#BO4] ✓ Found line "I saw 45 lion"
[tester::#BO4] ✓ Found line "I saw 12 lions"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "pineapple_cherry_banana" | ./your_program.sh -o -E '(banana|cherry|pineapple)'
[your_program] Logs from your program will appear here
[your_program] pineapple
[your_program] cherry
[your_program] banana
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "pineapple"
[tester::#SS2] ✓ Found line "cherry"
[tester::#SS2] ✓ Found line "banana"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] xx
[your_program] yy
[your_program] zz
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 pandas. Also, I see 4 rabbits." | ./your_program.sh -o -E 'I see \d+ (panda|rabbit)s?'
[your_program] I see 3 pandas
[your_program] I see 4 rabbits
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 pandas"
[tester::#SS2] ✓ Found line "I see 4 rabbits"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "banana_suffix" | ./your_program.sh -o -E '^banana'
[your_program] banana
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "banana"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_banana" | ./your_program.sh -o -E '^banana'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "apple\n!@#$\nbanana\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] apple
[your_program] banana
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "apple"
[tester::#PZ6] ✓ Found line "banana"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\ngiraffe\nitaly\nlion\nspain" | ./your_program.sh -E '(giraffe|lion)'
[your_program] Logs from your program will appear here
[your_program] giraffe
[your_program] lion
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "giraffe"
[tester::#PZ6] ✓ Found line "lion"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(giraffe|lion)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 orange\nINVALID\nLOG 20 pea\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (orange|pea)$'
[your_program] LOG 10 orange
[your_program] LOG 20 pea
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 orange"
[tester::#PZ6] ✓ Found line "LOG 20 pea"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "raspberry_suffix" | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[your_program] raspberry_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "raspberry_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_raspberry" | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "wtest" | ./your_program.sh -E '[watermelon]'
[your_program] Logs from your program will appear here
[your_program] wtest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "wtest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] act
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] caaats
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'pineapple_orange' | ./your_program.sh -E 'orange$'
[your_program] pineapple_orange
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'orange_pineapple' | ./your_program.sh -E 'orange$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[your_program] raspberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'raspberry_raspberry' | ./your_program.sh -E '^raspberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'blueberry_banana' | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[your_program] blueberry_banana
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'banana_blueberry' | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] sally has 124 apples
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 3 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'r' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] r
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'rcd' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[your_program] rcd
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'raspberry' | ./your_program.sh -E '[cdfghijkl]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[pear]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pear' | ./your_program.sh -E '\w'
[your_program] pear
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'BANANA' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] BANANA
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '250' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 250
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%÷×_-%#' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] %÷×_-%#
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%#-÷×+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] 123
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Nested Backreferences

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 31.9 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#XE5] Running tests for Stage #XE5 (Backreferences - Nested Backreferences)
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and cat"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] "cat and cat" is the same as "cat and cat"
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and dog"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep 101 is doing grep 101 times, and again grep 101 times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times, and again grep 101 times
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '$?! 101 is doing $?! 101 times, and again $?! 101 times' | ./your_program.sh -E '((\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep yes is doing grep yes times, and again grep yes times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not efg, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg, abc, or def
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'efg-hij is efg-hij, not klm, efg, or hij' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not xyz, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((\w+) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[your_program] apple pie is made of apple and pie. love apple pie
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'pineapple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((apple) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pies' | ./your_program.sh -E '^((\w+) (pie)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[your_program] "howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"hody hey there" is made up of "hody" and "hey". hody hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy heeey there" is made up of "howwdy" and "heeey". howwdy heeey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'cat and fish, cat with fish, cat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish, cat and fish
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'bat and fish, bat with fish, bat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] Test passed.
[tester::#TG1] Running tests for Stage #TG1 (Backreferences - Multiple Backreferences)
[tester::#TG1] $ echo -n '3 red squares and 3 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] 3 red squares and 3 red circles
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '3 red squares and 4 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep 101 is doing grep 101 times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '$?! 101 is doing $?! 101 times' | ./your_program.sh -E '(\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep yes is doing grep yes times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'efg-hij is efg-hij, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not xyz' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pie' | ./your_program.sh -E '^(\w+) (\w+), \1 and \2$'
[your_program] apple pie, apple and pie
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'pineapple pie, pineapple and pie' | ./your_program.sh -E '^(apple) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pies' | ./your_program.sh -E '^(\w+) (pie), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[your_program] howwdy hey there, howwdy hey
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'hody hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy heeey there, howwdy heeey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'cat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'bat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] Test passed.
[tester::#SB5] Running tests for Stage #SB5 (Backreferences - Single Backreference)
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(cat) and \1'
[your_program] cat and cat
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat is cat, not dog' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[your_program] cat is cat, not dog
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat is c@t, not d0g' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] Test passed.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'peaa_soup' | ./your_program.sh -E 'pea{2,4}_soup'
[your_program] Logs from your program will appear here
[your_program] peaa_soup
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'pea_soup' | ./your_program.sh -E 'pea{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'peaaaaa_soup' | ./your_program.sh -E 'pea{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'tiger836' | ./your_program.sh -E 'tiger\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] tiger836
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'strawberry,_ab' | ./your_program.sh -E 'strawberry,\w{1,3}'
[your_program] strawberry,_ab
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'elephanttigerrabbit' | ./your_program.sh -E '(tiger|rabbit|elephant){2,3}'
[your_program] Logs from your program will appear here
[your_program] elephanttigerrabbit
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'watermelonaei' | ./your_program.sh -E 'watermelon[aeiou]{2,4}'
[your_program] Logs from your program will appear here
[your_program] watermelonaei
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2020-3-10 2:0 LOG INFO device_registered' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] 2020-3-10 2:0 LOG INFO device_registered
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '5:9:55:2 WARN DEBUG device_registered' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'pearrr' | ./your_program.sh -E 'pearr{2,}'
[your_program] Logs from your program will appear here
[your_program] pearrr
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'pearrrrr' | ./your_program.sh -E 'pearr{2,}'
[your_program] Logs from your program will appear here
[your_program] pearrrrr
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'rabbit3162' | ./your_program.sh -E 'rabbit\d{3,}'
[your_program] Logs from your program will appear here
[your_program] rabbit3162
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'zucchini,_tag' | ./your_program.sh -E 'zucchini,\w{2,}'
[your_program] zucchini,_tag
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'onionzucchinicornonion' | ./your_program.sh -E '(zucchini|corn|onion){3,}'
[your_program] Logs from your program will appear here
[your_program] onionzucchinicornonion
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '09:27 LOG WARN session_validated' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 09:27 LOG WARN session_validated
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '02:40 LOG OK token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'raspberryyy' | ./your_program.sh -E 'raspberryy{2}'
[your_program] raspberryyy
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'dog411' | ./your_program.sh -E 'dog\d{3}'
[your_program] dog411
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'potato,_hi' | ./your_program.sh -E 'potato,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'wolfdog' | ./your_program.sh -E '(dog|wolf){2}'
[your_program] wolfdog
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'raspberryuoi' | ./your_program.sh -E 'raspberry[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] raspberryuoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2022-09-08 04:16 raspberry' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (raspberry|potato)$'
[your_program] Logs from your program will appear here
[your_program] 2022-09-08 04:16 raspberry
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2020-6-6 17:28 raspberry' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (raspberry|potato)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'pineapple' | ./your_program.sh -E 'pineapple*'
[your_program] Logs from your program will appear here
[your_program] pineapple
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'pineappl' | ./your_program.sh -E 'pineapple*'
[your_program] pineappl
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'horse5zebra' | ./your_program.sh -E 'horse\d*zebra'
[your_program] horse5zebra
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'pumpkin,_fresh' | ./your_program.sh -E 'pumpkin,\w*'
[your_program] pumpkin,_fresh
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'zebrahorsehorsezebra' | ./your_program.sh -E '(horse|zebra)*'
[your_program] Logs from your program will appear here
[your_program] zebrahorsehorsezebra
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 73 pineapple' | ./your_program.sh -E '^LOG [FION]* \d+ (pineapple|pumpkin)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 73 pineapple
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 11 pineapple' | ./your_program.sh -E '^LOG [FION]* \d+ (pineapple|pumpkin)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "strawberry" > "dir/fruits-9466.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-9466.txt"
[tester::#YX6] [setup] echo "lettuce" > "dir/subdir/vegetables-1641.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-1641.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-1641.txt"
[tester::#YX6] [setup] echo "broccoli" > "dir/vegetables-3139.txt"
[tester::#YX6] [setup] echo "onion" >> "dir/vegetables-3139.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-3139.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/subdir/vegetables-1641.txt:celery
[your_program] dir/subdir/vegetables-1641.txt:cauliflower
[your_program] dir/vegetables-3139.txt:cucumber
[your_program] dir/fruits-9466.txt:strawberry
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 4 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-9466.txt:pear
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_strawberry dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "apple" > "fruits-2451.txt"
[tester::#IS6] [setup] echo "pineapple" >> "fruits-2451.txt"
[tester::#IS6] [setup] echo "cauliflower" > "vegetables-8876.txt"
[tester::#IS6] [setup] echo "tomato" >> "vegetables-8876.txt"
[tester::#IS6] $ ./your_program.sh -E ap.+$ fruits-2451.txt vegetables-8876.txt
[your_program] Logs from your program will appear here
[your_program] fruits-2451.txt:apple
[your_program] fruits-2451.txt:pineapple
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 2 expected lines
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_cauliflower fruits-2451.txt vegetables-8876.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E cauliflower fruits-2451.txt vegetables-8876.txt
[your_program] vegetables-8876.txt:cauliflower
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "pear" > "fruits-2150.txt"
[tester::#OL9] [setup] echo "orange" >> "fruits-2150.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-2150.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-2150.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-2150.txt
[your_program] blueberry
[your_program] strawberry
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_cauliflower fruits-2150.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E pear fruits-2150.txt
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "watermelon" > "fruits-3181.txt"
[tester::#DR5] $ ./your_program.sh -E water.+ fruits-3181.txt
[your_program] Logs from your program will appear here
[your_program] watermelon
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_watermelon fruits-3181.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+melon fruits-3181.txt
[your_program] watermelon
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like cherry\nnothing here\nmango and cherry are tasty" | ./your_program.sh -o -E '(cherry|mango)'
[your_program] cherry
[your_program] mango
[your_program] cherry
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cherry"
[tester::#BO4] ✓ Found line "mango"
[tester::#BO4] ✓ Found line "cherry"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] cat
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 tiger and I saw 45 lion.\nNothing interesting today.\nLast week I saw 12 lions." | ./your_program.sh -o -E 'I saw \d+ (tiger|lion)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 tiger
[your_program] I saw 45 lion
[your_program] I saw 12 lions
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 tiger"
[tester::#BO4] ✓ Found line "I saw 45 lion"
[tester::#BO4] ✓ Found line "I saw 12 lions"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "mango_plum_blackberry" | ./your_program.sh -o -E '(blackberry|plum|mango)'
[your_program] mango
[your_program] Logs from your program will appear here
[your_program] plum
[your_program] blackberry
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "mango"
[tester::#SS2] ✓ Found line "plum"
[tester::#SS2] ✓ Found line "blackberry"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] xx
[your_program] yy
[your_program] zz
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 foxs. Also, I see 4 dogs." | ./your_program.sh -o -E 'I see \d+ (fox|dog)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 foxs
[your_program] I see 4 dogs
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 foxs"
[tester::#SS2] ✓ Found line "I see 4 dogs"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "grape_suffix" | ./your_program.sh -o -E '^grape'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "grape"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "prefix_grape" | ./your_program.sh -o -E '^grape'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] ✓ Stdout contains 1 expected line in order
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "raspberry\n!@#$\npear\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] raspberry
[your_program] pear
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "raspberry"
[tester::#PZ6] ✓ Found line "pear"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\npanda\nitaly\ncat\nspain" | ./your_program.sh -E '(panda|cat)'
[your_program] panda
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "panda"
[tester::#PZ6] ✓ Found line "cat"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(panda|cat)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 plum\nINVALID\nLOG 20 broccoli\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (plum|broccoli)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 plum
[your_program] LOG 20 broccoli
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 plum"
[tester::#PZ6] ✓ Found line "LOG 20 broccoli"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "raspberry_suffix" | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[your_program] raspberry_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "raspberry_suffix"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "prefix_raspberry" | ./your_program.sh -E '^raspberry'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] $ echo -ne "ptest" | ./your_program.sh -E '[plum]'
[your_program] ptest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "ptest"
[tester::#KU5] ✓ Stdout contains 1 expected line in order
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] goøö0Ogol
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] act
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'strawberry_raspberry' | ./your_program.sh -E 'raspberry$'
[your_program] strawberry_raspberry
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'raspberry_strawberry' | ./your_program.sh -E 'raspberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'pineapple' | ./your_program.sh -E '^pineapple$'
[your_program] Logs from your program will appear here
[your_program] pineapple
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pineapple_pineapple' | ./your_program.sh -E '^pineapple$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'orange_apple' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[your_program] orange_apple
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'apple_orange' | ./your_program.sh -E '^orange'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] sally has 124 apples
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 3 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 4 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'a' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[your_program] a
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'acd' | ./your_program.sh -E '[banana]'
[your_program] Logs from your program will appear here
[your_program] acd
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'pineapple' | ./your_program.sh -E '[bcdfghjkm]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[grape]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'pear' | ./your_program.sh -E '\w'
[your_program] pear
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'GRAPE' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] GRAPE
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '287' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 287
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%+#_÷+-' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] %+#_÷+-
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '#+÷=%×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
7️⃣ Highlighting
Highlighting a single match

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 16.4 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#BM2] Running tests for Stage #BM2 (Highlighting - Highlighting a single match)
[tester::#BM2] $ echo -ne "only1digit" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] only1digit
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "only1digit"
[tester::#BM2] ✓ All matches in the line "only1digit" are highlighted
[tester::#BM2] $ echo -ne "grape" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "pear_suffix" | ./your_program.sh --color=always -E '^pear' | cat
[your_program] Logs from your program will appear here
[your_program] pear_suffix
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "pear_suffix"
[tester::#BM2] ✓ All matches in the line "pear_suffix" are highlighted
[tester::#BM2] $ echo -ne "prefix_raspberry" | ./your_program.sh --color=always -E '^raspberry' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "caaaat" | ./your_program.sh --color=always -E 'ca+t' | cat
[your_program] caaaat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "caaaat"
[tester::#BM2] ✓ All matches in the line "caaaat" are highlighted
[tester::#BM2] $ echo -ne "I see 42 dogs" | ./your_program.sh --color=always -E '^I see \d+ (cat|dog)s?$' | cat
[your_program] I see 42 dogs
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "I see 42 dogs"
[tester::#BM2] ✓ All matches in the line "I see 42 dogs" are highlighted
[tester::#BM2] Test passed.
[tester::#XE5] Running tests for Stage #XE5 (Backreferences - Nested Backreferences)
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and cat"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[your_program] "cat and cat" is the same as "cat and cat"
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and dog"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep 101 is doing grep 101 times, and again grep 101 times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times, and again grep 101 times
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '$?! 101 is doing $?! 101 times, and again $?! 101 times' | ./your_program.sh -E '((\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep yes is doing grep yes times, and again grep yes times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not efg, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg, abc, or def
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'efg-hij is efg-hij, not klm, efg, or hij' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not xyz, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((\w+) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[your_program] apple pie is made of apple and pie. love apple pie
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'pineapple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((apple) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pies' | ./your_program.sh -E '^((\w+) (pie)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[your_program] "howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"hody hey there" is made up of "hody" and "hey". hody hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy heeey there" is made up of "howwdy" and "heeey". howwdy heeey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'cat and fish, cat with fish, cat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish, cat and fish
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'bat and fish, bat with fish, bat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] Test passed.
[tester::#TG1] Running tests for Stage #TG1 (Backreferences - Multiple Backreferences)
[tester::#TG1] $ echo -n '3 red squares and 3 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[your_program] 3 red squares and 3 red circles
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '3 red squares and 4 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep 101 is doing grep 101 times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '$?! 101 is doing $?! 101 times' | ./your_program.sh -E '(\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep yes is doing grep yes times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'efg-hij is efg-hij, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not xyz' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pie' | ./your_program.sh -E '^(\w+) (\w+), \1 and \2$'
[your_program] apple pie, apple and pie
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'pineapple pie, pineapple and pie' | ./your_program.sh -E '^(apple) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pies' | ./your_program.sh -E '^(\w+) (pie), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[your_program] howwdy hey there, howwdy hey
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'hody hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy heeey there, howwdy heeey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'cat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'bat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] Test passed.
[tester::#SB5] Running tests for Stage #SB5 (Backreferences - Single Backreference)
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat is cat, not dog' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[your_program] cat is cat, not dog
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat is c@t, not d0g' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] Test passed.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'tomatoo_soup' | ./your_program.sh -E 'tomato{2,4}_soup'
[your_program] Logs from your program will appear here
[your_program] tomatoo_soup
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'tomato_soup' | ./your_program.sh -E 'tomato{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'tomatooooo_soup' | ./your_program.sh -E 'tomato{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'cat595' | ./your_program.sh -E 'cat\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] cat595
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'lemon,_ab' | ./your_program.sh -E 'lemon,\w{1,3}'
[your_program] Logs from your program will appear here
[your_program] lemon,_ab
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'elephantcattiger' | ./your_program.sh -E '(cat|tiger|elephant){2,3}'
[your_program] Logs from your program will appear here
[your_program] elephantcattiger
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'appleaei' | ./your_program.sh -E 'apple[aeiou]{2,4}'
[your_program] Logs from your program will appear here
[your_program] appleaei
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2025-12-26 9:38 LOG DEBUG device_registered' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[your_program] 2025-12-26 9:38 LOG DEBUG device_registered
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '1:48:44:8 WARN INFO session_validated' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'pineappleee' | ./your_program.sh -E 'pineapplee{2,}'
[your_program] pineappleee
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'pineappleeee' | ./your_program.sh -E 'pineapplee{2,}'
[your_program] Logs from your program will appear here
[your_program] pineappleeee
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'rabbit2458' | ./your_program.sh -E 'rabbit\d{3,}'
[your_program] rabbit2458
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'lettuce,_tag' | ./your_program.sh -E 'lettuce,\w{2,}'
[your_program] Logs from your program will appear here
[your_program] lettuce,_tag
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'cabbagelettucepotatocabbage' | ./your_program.sh -E '(lettuce|potato|cabbage){3,}'
[your_program] Logs from your program will appear here
[your_program] cabbagelettucepotatocabbage
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '06:38 LOG INFO token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 06:38 LOG INFO token_created
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '17:57 LOG OK device_registered' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'appleee' | ./your_program.sh -E 'applee{2}'
[your_program] Logs from your program will appear here
[your_program] appleee
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'horse243' | ./your_program.sh -E 'horse\d{3}'
[your_program] Logs from your program will appear here
[your_program] horse243
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'corn,_hi' | ./your_program.sh -E 'corn,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'zebrahorse' | ./your_program.sh -E '(horse|zebra){2}'
[your_program] Logs from your program will appear here
[your_program] zebrahorse
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'appleuoi' | ./your_program.sh -E 'apple[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] appleuoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2023-08-15 02:48 apple' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (apple|corn)$'
[your_program] Logs from your program will appear here
[your_program] 2023-08-15 02:48 apple
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2022-9-6 21:16 apple' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (apple|corn)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'mango' | ./your_program.sh -E 'mango*'
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'mang' | ./your_program.sh -E 'mango*'
[your_program] Logs from your program will appear here
[your_program] mang
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'lion28tiger' | ./your_program.sh -E 'lion\d*tiger'
[your_program] Logs from your program will appear here
[your_program] lion28tiger
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'tomato,_fresh' | ./your_program.sh -E 'tomato,\w*'
[your_program] Logs from your program will appear here
[your_program] tomato,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'tigerlionliontiger' | ./your_program.sh -E '(lion|tiger)*'
[your_program] Logs from your program will appear here
[your_program] tigerlionliontiger
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 51 mango' | ./your_program.sh -E '^LOG [FION]* \d+ (mango|tomato)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 51 mango
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 68 mango' | ./your_program.sh -E '^LOG [FION]* \d+ (mango|tomato)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "grape" > "dir/fruits-6396.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-6396.txt"
[tester::#YX6] [setup] echo "pumpkin" > "dir/subdir/vegetables-2565.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-2565.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-2565.txt"
[tester::#YX6] [setup] echo "corn" > "dir/vegetables-8316.txt"
[tester::#YX6] [setup] echo "cabbage" >> "dir/vegetables-8316.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-8316.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/subdir/vegetables-2565.txt:celery
[your_program] dir/subdir/vegetables-2565.txt:cauliflower
[your_program] dir/vegetables-8316.txt:cucumber
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 3 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-6396.txt:pear
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_grape dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "plum" > "fruits-2404.txt"
[tester::#IS6] [setup] echo "strawberry" >> "fruits-2404.txt"
[tester::#IS6] [setup] echo "lettuce" > "vegetables-5017.txt"
[tester::#IS6] [setup] echo "corn" >> "vegetables-5017.txt"
[tester::#IS6] $ ./your_program.sh -E pl.+$ fruits-2404.txt vegetables-5017.txt
[your_program] Logs from your program will appear here
[your_program] fruits-2404.txt:plum
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_lettuce fruits-2404.txt vegetables-5017.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E lettuce fruits-2404.txt vegetables-5017.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-5017.txt:lettuce
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "strawberry" > "fruits-2630.txt"
[tester::#OL9] [setup] echo "orange" >> "fruits-2630.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-2630.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-2630.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-2630.txt
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 3 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_cabbage fruits-2630.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E strawberry fruits-2630.txt
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "blackberry" > "fruits-8598.txt"
[tester::#DR5] $ ./your_program.sh -E black.+ fruits-8598.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_blackberry fruits-8598.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+berry fruits-8598.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like watermelon\nnothing here\npineapple and watermelon are tasty" | ./your_program.sh -o -E '(watermelon|pineapple)'
[your_program] Logs from your program will appear here
[your_program] watermelon
[your_program] pineapple
[your_program] watermelon
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "watermelon"
[tester::#BO4] ✓ Found line "pineapple"
[tester::#BO4] ✓ Found line "watermelon"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 wolf and I saw 45 tiger.\nNothing interesting today.\nLast week I saw 12 tigers." | ./your_program.sh -o -E 'I saw \d+ (wolf|tiger)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 wolf
[your_program] I saw 45 tiger
[your_program] I saw 12 tigers
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 wolf"
[tester::#BO4] ✓ Found line "I saw 45 tiger"
[tester::#BO4] ✓ Found line "I saw 12 tigers"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "mango_plum_cherry" | ./your_program.sh -o -E '(cherry|plum|mango)'
[your_program] Logs from your program will appear here
[your_program] mango
[your_program] plum
[your_program] cherry
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "mango"
[tester::#SS2] ✓ Found line "plum"
[tester::#SS2] ✓ Found line "cherry"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 lions. Also, I see 4 dogs." | ./your_program.sh -o -E 'I see \d+ (lion|dog)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 lions
[your_program] I see 4 dogs
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 lions"
[tester::#SS2] ✓ Found line "I see 4 dogs"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "pear_suffix" | ./your_program.sh -o -E '^pear'
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "pear"
[tester::#CJ0] $ echo -ne "prefix_pear" | ./your_program.sh -o -E '^pear'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] dog456
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "orange\n!@#$\napple\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] orange
[your_program] apple
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "orange"
[tester::#PZ6] ✓ Found line "apple"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nmonkey\nitaly\ncat\nspain" | ./your_program.sh -E '(monkey|cat)'
[your_program] monkey
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "monkey"
[tester::#PZ6] ✓ Found line "cat"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(monkey|cat)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 pear\nINVALID\nLOG 20 pea\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (pear|pea)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 pear
[your_program] LOG 20 pea
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 pear"
[tester::#PZ6] ✓ Found line "LOG 20 pea"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "blueberry_suffix" | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[your_program] blueberry_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "blueberry_suffix"
[tester::#KU5] $ echo -ne "prefix_blueberry" | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] $ echo -ne "otest" | ./your_program.sh -E '[orange]'
[your_program] otest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "otest"
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] a cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] I see 1 cat
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] act
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] abc_123_xyz
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'orange_pineapple' | ./your_program.sh -E 'pineapple$'
[your_program] Logs from your program will appear here
[your_program] orange_pineapple
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pineapple_orange' | ./your_program.sh -E 'pineapple$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'grape' | ./your_program.sh -E '^grape$'
[your_program] grape
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'grape_grape' | ./your_program.sh -E '^grape$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'blueberry_raspberry' | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[your_program] blueberry_raspberry
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'raspberry_blueberry' | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'n' | ./your_program.sh -E '[mango]'
[your_program] n
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'nbc' | ./your_program.sh -E '[mango]'
[your_program] nbc
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'orange' | ./your_program.sh -E '[bcdfhi]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[pineapple]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'grape' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'PEAR' | ./your_program.sh -E '\w'
[your_program] PEAR
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '351' | ./your_program.sh -E '\w'
[your_program] 351
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=+÷_+%=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] =+÷_+%=
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%-÷=×#' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] abc_0_xyz
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Highlighting multiple matches

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 17.6 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#EQ0] Running tests for Stage #EQ0 (Highlighting - Highlighting multiple matches)
[tester::#EQ0] $ echo -ne "a1b2c3" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] a1b2c3
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "a1b2c3"
[tester::#EQ0] ✓ All matches in the line "a1b2c3" are highlighted
[tester::#EQ0] $ echo -ne "tiger_monkey_elephant" | ./your_program.sh --color=always -E '(monkey|elephant|tiger)' | cat
[your_program] Logs from your program will appear here
[your_program] tiger_monkey_elephant
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "tiger_monkey_elephant"
[tester::#EQ0] ✓ All matches in the line "tiger_monkey_elephant" are highlighted
[tester::#EQ0] $ echo -ne "grape" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#EQ0] ✓ Received exit code 1.
[tester::#EQ0] ✓ No output found
[tester::#EQ0] $ echo -ne "xxyyzz" | ./your_program.sh --color=always -E '\w\w' | cat
[your_program] Logs from your program will appear here
[your_program] xxyyzz
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "xxyyzz"
[tester::#EQ0] ✓ All matches in the line "xxyyzz" are highlighted
[tester::#EQ0] $ echo -ne "$$##@@" | ./your_program.sh --color=always -E '\w' | cat
[your_program] Logs from your program will appear here
[tester::#EQ0] ✓ Received exit code 1.
[tester::#EQ0] ✓ No output found
[tester::#EQ0] $ echo -ne "I see 3 cabbages. Also, I see 4 onions." | ./your_program.sh --color=always -E 'I see \d+ (onion|cabbage)s?' | cat
[your_program] Logs from your program will appear here
[your_program] I see 3 cabbages. Also, I see 4 onions.
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "I see 3 cabbages. Also, I see 4 onions."
[tester::#EQ0] ✓ All matches in the line "I see 3 cabbages. Also, I see 4 onions." are highlighted
[tester::#EQ0] Test passed.
[tester::#BM2] Running tests for Stage #BM2 (Highlighting - Highlighting a single match)
[tester::#BM2] $ echo -ne "only1digit" | ./your_program.sh --color=always -E '\d' | cat
[your_program] only1digit
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "only1digit"
[tester::#BM2] ✓ All matches in the line "only1digit" are highlighted
[tester::#BM2] $ echo -ne "cherry" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "pear_suffix" | ./your_program.sh --color=always -E '^pear' | cat
[your_program] Logs from your program will appear here
[your_program] pear_suffix
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "pear_suffix"
[tester::#BM2] ✓ All matches in the line "pear_suffix" are highlighted
[tester::#BM2] $ echo -ne "prefix_grape" | ./your_program.sh --color=always -E '^grape' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "caaaat" | ./your_program.sh --color=always -E 'ca+t' | cat
[your_program] Logs from your program will appear here
[your_program] caaaat
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "caaaat"
[tester::#BM2] ✓ All matches in the line "caaaat" are highlighted
[tester::#BM2] $ echo -ne "I see 42 dogs" | ./your_program.sh --color=always -E '^I see \d+ (cat|dog)s?$' | cat
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "I see 42 dogs"
[tester::#BM2] ✓ All matches in the line "I see 42 dogs" are highlighted
[tester::#BM2] Test passed.
[tester::#XE5] Running tests for Stage #XE5 (Backreferences - Nested Backreferences)
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and cat"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[your_program] "cat and cat" is the same as "cat and cat"
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and dog"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep 101 is doing grep 101 times, and again grep 101 times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times, and again grep 101 times
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '$?! 101 is doing $?! 101 times, and again $?! 101 times' | ./your_program.sh -E '((\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep yes is doing grep yes times, and again grep yes times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not efg, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg, abc, or def
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'efg-hij is efg-hij, not klm, efg, or hij' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not xyz, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((\w+) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[your_program] apple pie is made of apple and pie. love apple pie
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'pineapple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((apple) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pies' | ./your_program.sh -E '^((\w+) (pie)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[your_program] "howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"hody hey there" is made up of "hody" and "hey". hody hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy heeey there" is made up of "howwdy" and "heeey". howwdy heeey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'cat and fish, cat with fish, cat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish, cat and fish
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'bat and fish, bat with fish, bat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] Test passed.
[tester::#TG1] Running tests for Stage #TG1 (Backreferences - Multiple Backreferences)
[tester::#TG1] $ echo -n '3 red squares and 3 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] 3 red squares and 3 red circles
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '3 red squares and 4 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep 101 is doing grep 101 times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '$?! 101 is doing $?! 101 times' | ./your_program.sh -E '(\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep yes is doing grep yes times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'efg-hij is efg-hij, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not xyz' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pie' | ./your_program.sh -E '^(\w+) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[your_program] apple pie, apple and pie
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'pineapple pie, pineapple and pie' | ./your_program.sh -E '^(apple) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pies' | ./your_program.sh -E '^(\w+) (pie), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[your_program] howwdy hey there, howwdy hey
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'hody hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy heeey there, howwdy heeey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'cat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'bat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] Test passed.
[tester::#SB5] Running tests for Stage #SB5 (Backreferences - Single Backreference)
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat is cat, not dog' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[your_program] cat is cat, not dog
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat is c@t, not d0g' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] Test passed.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'cornnn_soup' | ./your_program.sh -E 'corn{2,4}_soup'
[your_program] cornnn_soup
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'corn_soup' | ./your_program.sh -E 'corn{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'cornnnnn_soup' | ./your_program.sh -E 'corn{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'fox587' | ./your_program.sh -E 'fox\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] fox587
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'orange,_ab' | ./your_program.sh -E 'orange,\w{1,3}'
[your_program] orange,_ab
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'giraffefoxzebra' | ./your_program.sh -E '(fox|zebra|giraffe){2,3}'
[your_program] giraffefoxzebra
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'plumaei' | ./your_program.sh -E 'plum[aeiou]{2,4}'
[your_program] plumaei
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2021-8-16 12:33 LOG INFO device_registered' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] 2021-8-16 12:33 LOG INFO device_registered
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '8:49:43:5 WARN INFO token_created' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'grapeee' | ./your_program.sh -E 'grapee{2,}'
[your_program] grapeee
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'grapeeeee' | ./your_program.sh -E 'grapee{2,}'
[your_program] grapeeeee
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'lion8950' | ./your_program.sh -E 'lion\d{3,}'
[your_program] Logs from your program will appear here
[your_program] lion8950
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'potato,_tag' | ./your_program.sh -E 'potato,\w{2,}'
[your_program] Logs from your program will appear here
[your_program] potato,_tag
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'carrotpotatoonioncarrot' | ./your_program.sh -E '(potato|onion|carrot){3,}'
[your_program] Logs from your program will appear here
[your_program] carrotpotatoonioncarrot
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '14:24 LOG INFO token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 14:24 LOG INFO token_created
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '07:09 LOG OK token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'mangooo' | ./your_program.sh -E 'mangoo{2}'
[your_program] Logs from your program will appear here
[your_program] mangooo
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'panda861' | ./your_program.sh -E 'panda\d{3}'
[your_program] Logs from your program will appear here
[your_program] panda861
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'potato,_hi' | ./your_program.sh -E 'potato,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'dogpanda' | ./your_program.sh -E '(panda|dog){2}'
[your_program] Logs from your program will appear here
[your_program] dogpanda
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'mangouoi' | ./your_program.sh -E 'mango[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] mangouoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2023-11-19 00:46 mango' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (mango|potato)$'
[your_program] 2023-11-19 00:46 mango
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2022-4-1 16:40 mango' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (mango|potato)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'grape' | ./your_program.sh -E 'grape*'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'grap' | ./your_program.sh -E 'grape*'
[your_program] Logs from your program will appear here
[your_program] grap
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'dog70tiger' | ./your_program.sh -E 'dog\d*tiger'
[your_program] Logs from your program will appear here
[your_program] dog70tiger
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'cauliflower,_fresh' | ./your_program.sh -E 'cauliflower,\w*'
[your_program] Logs from your program will appear here
[your_program] cauliflower,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'tigerdogdogtiger' | ./your_program.sh -E '(dog|tiger)*'
[your_program] Logs from your program will appear here
[your_program] tigerdogdogtiger
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 76 grape' | ./your_program.sh -E '^LOG [FION]* \d+ (grape|cauliflower)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 76 grape
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 34 grape' | ./your_program.sh -E '^LOG [FION]* \d+ (grape|cauliflower)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "cherry" > "dir/fruits-3872.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-3872.txt"
[tester::#YX6] [setup] echo "spinach" > "dir/subdir/vegetables-1002.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-1002.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-1002.txt"
[tester::#YX6] [setup] echo "onion" > "dir/vegetables-8429.txt"
[tester::#YX6] [setup] echo "potato" >> "dir/vegetables-8429.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-8429.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/subdir/vegetables-1002.txt:celery
[your_program] dir/subdir/vegetables-1002.txt:cauliflower
[your_program] dir/fruits-3872.txt:cherry
[your_program] dir/vegetables-8429.txt:cucumber
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 4 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/fruits-3872.txt:pear
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_cherry dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "pear" > "fruits-6459.txt"
[tester::#IS6] [setup] echo "mango" >> "fruits-6459.txt"
[tester::#IS6] [setup] echo "spinach" > "vegetables-3935.txt"
[tester::#IS6] [setup] echo "cauliflower" >> "vegetables-3935.txt"
[tester::#IS6] $ ./your_program.sh -E pe.+$ fruits-6459.txt vegetables-3935.txt
[your_program] Logs from your program will appear here
[your_program] fruits-6459.txt:pear
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_spinach fruits-6459.txt vegetables-3935.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E spinach fruits-6459.txt vegetables-3935.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-3935.txt:spinach
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "cherry" > "fruits-1678.txt"
[tester::#OL9] [setup] echo "mango" >> "fruits-1678.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-1678.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-1678.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-1678.txt
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 2 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_potato fruits-1678.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E cherry fruits-1678.txt
[your_program] Logs from your program will appear here
[your_program] cherry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "grape" > "fruits-6812.txt"
[tester::#DR5] $ ./your_program.sh -E gr.+ fruits-6812.txt
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_grape fruits-6812.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+ape fruits-6812.txt
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like pear\nnothing here\norange and pear are tasty" | ./your_program.sh -o -E '(pear|orange)'
[your_program] Logs from your program will appear here
[your_program] pear
[your_program] orange
[your_program] pear
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "pear"
[tester::#BO4] ✓ Found line "orange"
[tester::#BO4] ✓ Found line "pear"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 panda and I saw 45 lion.\nNothing interesting today.\nLast week I saw 12 lions." | ./your_program.sh -o -E 'I saw \d+ (panda|lion)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 panda
[your_program] I saw 45 lion
[your_program] I saw 12 lions
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 panda"
[tester::#BO4] ✓ Found line "I saw 45 lion"
[tester::#BO4] ✓ Found line "I saw 12 lions"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] 1
[your_program] 2
[your_program] 3
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "watermelon_blackberry_orange" | ./your_program.sh -o -E '(orange|blackberry|watermelon)'
[your_program] watermelon
[your_program] blackberry
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "watermelon"
[tester::#SS2] ✓ Found line "blackberry"
[tester::#SS2] ✓ Found line "orange"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 rabbits. Also, I see 4 elephants." | ./your_program.sh -o -E 'I see \d+ (rabbit|elephant)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 rabbits
[your_program] I see 4 elephants
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 rabbits"
[tester::#SS2] ✓ Found line "I see 4 elephants"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "orange_suffix" | ./your_program.sh -o -E '^orange'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "orange"
[tester::#CJ0] $ echo -ne "prefix_orange" | ./your_program.sh -o -E '^orange'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "grape\n!@#$\npear\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] grape
[your_program] pear
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "grape"
[tester::#PZ6] ✓ Found line "pear"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nhorse\nitaly\nzebra\nspain" | ./your_program.sh -E '(horse|zebra)'
[your_program] Logs from your program will appear here
[your_program] horse
[your_program] zebra
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "horse"
[tester::#PZ6] ✓ Found line "zebra"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(horse|zebra)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 blackberry\nINVALID\nLOG 20 lettuce\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (blackberry|lettuce)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 blackberry
[your_program] LOG 20 lettuce
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 blackberry"
[tester::#PZ6] ✓ Found line "LOG 20 lettuce"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "grape_suffix" | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[your_program] grape_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "grape_suffix"
[tester::#KU5] $ echo -ne "prefix_grape" | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] $ echo -ne "otest" | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[your_program] otest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "otest"
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] goøö0Ogol
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] caaats
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'pear_mango' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[your_program] pear_mango
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'mango_pear' | ./your_program.sh -E 'mango$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'strawberry' | ./your_program.sh -E '^strawberry$'
[your_program] Logs from your program will appear here
[your_program] strawberry
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'strawberry_strawberry' | ./your_program.sh -E '^strawberry$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'strawberry_blueberry' | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[your_program] strawberry_blueberry
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'blueberry_strawberry' | ./your_program.sh -E '^strawberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] sally has 3 dogs
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 's' | ./your_program.sh -E '[raspberry]'
[your_program] Logs from your program will appear here
[your_program] s
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'scd' | ./your_program.sh -E '[raspberry]'
[your_program] Logs from your program will appear here
[your_program] scd
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'blueberry' | ./your_program.sh -E '[acdfghijk]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'blueberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] blueberry
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'GRAPE' | ./your_program.sh -E '\w'
[your_program] GRAPE
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '118' | ./your_program.sh -E '\w'
[your_program] 118
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=×+_#+×' | ./your_program.sh -E '\w'
[your_program] =×+_#+×
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '÷%+×#-' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] 123
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Highlighting in multiple lines

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 17.1 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#JK4] Running tests for Stage #JK4 (Highlighting - Disabling highlighting)
[tester::#JK4] $ echo -ne "1elephant" | ./your_program.sh --color=never -E '\d' | cat
[your_program] 1elephant
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "1elephant"
[tester::#JK4] ✓ Line "1elephant" is not highlighted
[tester::#JK4] $ echo -ne "panda" | ./your_program.sh --color=never -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 1.
[tester::#JK4] ✓ No output found
[tester::#JK4] $ echo -ne "pear_suffix" | ./your_program.sh --color=never -E '^pear' | cat
[your_program] pear_suffix
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "pear_suffix"
[tester::#JK4] ✓ Line "pear_suffix" is not highlighted
[tester::#JK4] $ echo -ne "prefix_mango" | ./your_program.sh --color=never -E '^mango' | cat
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 1.
[tester::#JK4] ✓ No output found
[tester::#JK4] $ echo -ne "doooog" | ./your_program.sh --color=never -E 'do+g' | cat
[your_program] Logs from your program will appear here
[your_program] doooog
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "doooog"
[tester::#JK4] ✓ Line "doooog" is not highlighted
[tester::#JK4] $ echo -ne "It's raining elephant and panda\nIt's raining panda and elephant" | ./your_program.sh --color=never -E '(elephant|panda)' | cat
[your_program] Logs from your program will appear here
[your_program] It's raining elephant and panda
[your_program] It's raining panda and elephant
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "It's raining elephant and panda"
[tester::#JK4] ✓ Found line "It's raining panda and elephant"
[tester::#JK4] ✓ Stdout contains 2 expected lines in order
[tester::#JK4] ✓ Line "It's raining elephant and panda" is not highlighted
[tester::#JK4] ✓ Line "It's raining panda and elephant" is not highlighted
[tester::#JK4] Test passed.
[tester::#WG2] Running tests for Stage #WG2 (Highlighting - Highlighting in multiple lines)
[tester::#WG2] $ echo -ne "a1b2c3\nno digits here\n456def" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] a1b2c3
[your_program] 456def
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "a1b2c3"
[tester::#WG2] ✓ Found line "456def"
[tester::#WG2] ✓ Stdout contains 2 expected lines in order
[tester::#WG2] ✓ All matches in the line "a1b2c3" are highlighted
[tester::#WG2] ✓ All matches in the line "456def" are highlighted
[tester::#WG2] $ echo -ne "monkey_elephant_wolf\nno_animal_here\nelephant and wolf" | ./your_program.sh --color=always -E '(elephant|wolf|monkey)' | cat
[your_program] Logs from your program will appear here
[your_program] monkey_elephant_wolf
[your_program] elephant and wolf
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "monkey_elephant_wolf"
[tester::#WG2] ✓ Found line "elephant and wolf"
[tester::#WG2] ✓ Stdout contains 2 expected lines in order
[tester::#WG2] ✓ All matches in the line "monkey_elephant_wolf" are highlighted
[tester::#WG2] ✓ All matches in the line "elephant and wolf" are highlighted
[tester::#WG2] $ echo -ne "blueberry\nelephant\ncabbage" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#WG2] ✓ Received exit code 1.
[tester::#WG2] ✓ No output found
[tester::#WG2] $ echo -ne "xxyyzz\nab cd ef\nmango" | ./your_program.sh --color=always -E '\w\w' | cat
[your_program] Logs from your program will appear here
[your_program] xxyyzz
[your_program] ab cd ef
[your_program] mango
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "xxyyzz"
[tester::#WG2] ✓ Found line "ab cd ef"
[tester::#WG2] ✓ Found line "mango"
[tester::#WG2] ✓ Stdout contains 3 expected lines in order
[tester::#WG2] ✓ All matches in the line "xxyyzz" are highlighted
[tester::#WG2] ✓ All matches in the line "ab cd ef" are highlighted
[tester::#WG2] ✓ All matches in the line "mango" are highlighted
[tester::#WG2] $ echo -ne "$$##@@\n!@#$%^\n+++---" | ./your_program.sh --color=always -E '\w' | cat
[your_program] Logs from your program will appear here
[tester::#WG2] ✓ Received exit code 1.
[tester::#WG2] ✓ No output found
[tester::#WG2] $ echo -ne "I see 3 potatos. Also, I see 4 cabbages.\nI ate 10 cabbage today" | ./your_program.sh --color=always -E 'I see \d+ (cabbage|potato)s?' | cat
[your_program] Logs from your program will appear here
[your_program] I see 3 potatos. Also, I see 4 cabbages.
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "I see 3 potatos. Also, I see 4 cabbages."
[tester::#WG2] ✓ All matches in the line "I see 3 potatos. Also, I see 4 cabbages." are highlighted
[tester::#WG2] Test passed.
[tester::#EQ0] Running tests for Stage #EQ0 (Highlighting - Highlighting multiple matches)
[tester::#EQ0] $ echo -ne "a1b2c3" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] a1b2c3
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "a1b2c3"
[tester::#EQ0] ✓ All matches in the line "a1b2c3" are highlighted
[tester::#EQ0] $ echo -ne "wolf_elephant_zebra" | ./your_program.sh --color=always -E '(elephant|zebra|wolf)' | cat
[your_program] Logs from your program will appear here
[your_program] wolf_elephant_zebra
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "wolf_elephant_zebra"
[tester::#EQ0] ✓ All matches in the line "wolf_elephant_zebra" are highlighted
[tester::#EQ0] $ echo -ne "grape" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#EQ0] ✓ Received exit code 1.
[tester::#EQ0] ✓ No output found
[tester::#EQ0] $ echo -ne "xxyyzz" | ./your_program.sh --color=always -E '\w\w' | cat
[your_program] Logs from your program will appear here
[your_program] xxyyzz
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "xxyyzz"
[tester::#EQ0] ✓ All matches in the line "xxyyzz" are highlighted
[tester::#EQ0] $ echo -ne "$$##@@" | ./your_program.sh --color=always -E '\w' | cat
[your_program] Logs from your program will appear here
[tester::#EQ0] ✓ Received exit code 1.
[tester::#EQ0] ✓ No output found
[tester::#EQ0] $ echo -ne "I see 3 cabbages. Also, I see 4 peas." | ./your_program.sh --color=always -E 'I see \d+ (pea|cabbage)s?' | cat
[your_program] Logs from your program will appear here
[your_program] I see 3 cabbages. Also, I see 4 peas.
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "I see 3 cabbages. Also, I see 4 peas."
[tester::#EQ0] ✓ All matches in the line "I see 3 cabbages. Also, I see 4 peas." are highlighted
[tester::#EQ0] Test passed.
[tester::#BM2] Running tests for Stage #BM2 (Highlighting - Highlighting a single match)
[tester::#BM2] $ echo -ne "only1digit" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] only1digit
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "only1digit"
[tester::#BM2] ✓ All matches in the line "only1digit" are highlighted
[tester::#BM2] $ echo -ne "lemon" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "raspberry_suffix" | ./your_program.sh --color=always -E '^raspberry' | cat
[your_program] Logs from your program will appear here
[your_program] raspberry_suffix
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "raspberry_suffix"
[tester::#BM2] ✓ All matches in the line "raspberry_suffix" are highlighted
[tester::#BM2] $ echo -ne "prefix_blueberry" | ./your_program.sh --color=always -E '^blueberry' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "caaaat" | ./your_program.sh --color=always -E 'ca+t' | cat
[your_program] caaaat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "caaaat"
[tester::#BM2] ✓ All matches in the line "caaaat" are highlighted
[tester::#BM2] $ echo -ne "I see 42 dogs" | ./your_program.sh --color=always -E '^I see \d+ (cat|dog)s?$' | cat
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "I see 42 dogs"
[tester::#BM2] ✓ All matches in the line "I see 42 dogs" are highlighted
[tester::#BM2] Test passed.
[tester::#XE5] Running tests for Stage #XE5 (Backreferences - Nested Backreferences)
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and cat"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[your_program] "cat and cat" is the same as "cat and cat"
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and dog"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep 101 is doing grep 101 times, and again grep 101 times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times, and again grep 101 times
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '$?! 101 is doing $?! 101 times, and again $?! 101 times' | ./your_program.sh -E '((\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep yes is doing grep yes times, and again grep yes times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not efg, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg, abc, or def
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'efg-hij is efg-hij, not klm, efg, or hij' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not xyz, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((\w+) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[your_program] apple pie is made of apple and pie. love apple pie
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'pineapple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((apple) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pies' | ./your_program.sh -E '^((\w+) (pie)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[your_program] "howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"hody hey there" is made up of "hody" and "hey". hody hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy heeey there" is made up of "howwdy" and "heeey". howwdy heeey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'cat and fish, cat with fish, cat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish, cat and fish
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'bat and fish, bat with fish, bat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] Test passed.
[tester::#TG1] Running tests for Stage #TG1 (Backreferences - Multiple Backreferences)
[tester::#TG1] $ echo -n '3 red squares and 3 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[your_program] 3 red squares and 3 red circles
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '3 red squares and 4 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep 101 is doing grep 101 times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '$?! 101 is doing $?! 101 times' | ./your_program.sh -E '(\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep yes is doing grep yes times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'efg-hij is efg-hij, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not xyz' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pie' | ./your_program.sh -E '^(\w+) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[your_program] apple pie, apple and pie
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'pineapple pie, pineapple and pie' | ./your_program.sh -E '^(apple) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pies' | ./your_program.sh -E '^(\w+) (pie), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[your_program] howwdy hey there, howwdy hey
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'hody hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy heeey there, howwdy heeey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'cat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'bat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] Test passed.
[tester::#SB5] Running tests for Stage #SB5 (Backreferences - Single Backreference)
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(cat) and \1'
[your_program] cat and cat
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat is cat, not dog' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[your_program] cat is cat, not dog
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat is c@t, not d0g' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] Test passed.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'tomatoo_soup' | ./your_program.sh -E 'tomato{2,4}_soup'
[your_program] Logs from your program will appear here
[your_program] tomatoo_soup
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'tomato_soup' | ./your_program.sh -E 'tomato{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'tomatooooo_soup' | ./your_program.sh -E 'tomato{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'fox923' | ./your_program.sh -E 'fox\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] fox923
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'grape,_ab' | ./your_program.sh -E 'grape,\w{1,3}'
[your_program] grape,_ab
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'wolffoxpanda' | ./your_program.sh -E '(fox|panda|wolf){2,3}'
[your_program] Logs from your program will appear here
[your_program] wolffoxpanda
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'orangeaei' | ./your_program.sh -E 'orange[aeiou]{2,4}'
[your_program] Logs from your program will appear here
[your_program] orangeaei
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2021-11-13 16:1 LOG INFO session_validated' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[your_program] 2021-11-13 16:1 LOG INFO session_validated
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '18:19:9:4 WARN INFO session_validated' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'pearrr' | ./your_program.sh -E 'pearr{2,}'
[your_program] Logs from your program will appear here
[your_program] pearrr
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'pearrrr' | ./your_program.sh -E 'pearr{2,}'
[your_program] Logs from your program will appear here
[your_program] pearrrr
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'wolf683' | ./your_program.sh -E 'wolf\d{3,}'
[your_program] Logs from your program will appear here
[your_program] wolf683
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'zucchini,_tag' | ./your_program.sh -E 'zucchini,\w{2,}'
[your_program] Logs from your program will appear here
[your_program] zucchini,_tag
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'peazucchinibroccolipea' | ./your_program.sh -E '(zucchini|broccoli|pea){3,}'
[your_program] Logs from your program will appear here
[your_program] peazucchinibroccolipea
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '13:50 LOG WARN session_validated' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 13:50 LOG WARN session_validated
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '15:41 LOG OK device_registered' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'grapeee' | ./your_program.sh -E 'grapee{2}'
[your_program] Logs from your program will appear here
[your_program] grapeee
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'giraffe521' | ./your_program.sh -E 'giraffe\d{3}'
[your_program] Logs from your program will appear here
[your_program] giraffe521
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'cauliflower,_hi' | ./your_program.sh -E 'cauliflower,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'pandagiraffe' | ./your_program.sh -E '(giraffe|panda){2}'
[your_program] Logs from your program will appear here
[your_program] pandagiraffe
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'grapeuoi' | ./your_program.sh -E 'grape[aeiou]{3}'
[your_program] Logs from your program will appear here
[your_program] grapeuoi
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2020-02-13 01:48 grape' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (grape|cauliflower)$'
[your_program] Logs from your program will appear here
[your_program] 2020-02-13 01:48 grape
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2023-4-4 21:41 grape' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (grape|cauliflower)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'mango' | ./your_program.sh -E 'mango*'
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'mang' | ./your_program.sh -E 'mango*'
[your_program] Logs from your program will appear here
[your_program] mang
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'fox24rabbit' | ./your_program.sh -E 'fox\d*rabbit'
[your_program] Logs from your program will appear here
[your_program] fox24rabbit
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'corn,_fresh' | ./your_program.sh -E 'corn,\w*'
[your_program] Logs from your program will appear here
[your_program] corn,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'rabbitfoxfoxrabbit' | ./your_program.sh -E '(fox|rabbit)*'
[your_program] Logs from your program will appear here
[your_program] rabbitfoxfoxrabbit
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 89 mango' | ./your_program.sh -E '^LOG [FION]* \d+ (mango|corn)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 89 mango
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 47 mango' | ./your_program.sh -E '^LOG [FION]* \d+ (mango|corn)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "apple" > "dir/fruits-6894.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-6894.txt"
[tester::#YX6] [setup] echo "zucchini" > "dir/subdir/vegetables-6456.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-6456.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-6456.txt"
[tester::#YX6] [setup] echo "lettuce" > "dir/vegetables-1491.txt"
[tester::#YX6] [setup] echo "asparagus" >> "dir/vegetables-1491.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-1491.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/subdir/vegetables-6456.txt:celery
[your_program] dir/subdir/vegetables-6456.txt:cauliflower
[your_program] dir/vegetables-1491.txt:cucumber
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 3 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] Logs from your program will appear here
[your_program] dir/vegetables-1491.txt:asparagus
[your_program] dir/fruits-6894.txt:pear
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 2 expected lines
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_apple dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "pineapple" > "fruits-9860.txt"
[tester::#IS6] [setup] echo "cherry" >> "fruits-9860.txt"
[tester::#IS6] [setup] echo "cauliflower" > "vegetables-7319.txt"
[tester::#IS6] [setup] echo "asparagus" >> "vegetables-7319.txt"
[tester::#IS6] $ ./your_program.sh -E pi.+$ fruits-9860.txt vegetables-7319.txt
[your_program] Logs from your program will appear here
[your_program] fruits-9860.txt:pineapple
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_cauliflower fruits-9860.txt vegetables-7319.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E cauliflower fruits-9860.txt vegetables-7319.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-7319.txt:cauliflower
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "blackberry" > "fruits-1976.txt"
[tester::#OL9] [setup] echo "banana" >> "fruits-1976.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-1976.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-1976.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-1976.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 3 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_tomato fruits-1976.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E blackberry fruits-1976.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "pear" > "fruits-9137.txt"
[tester::#DR5] $ ./your_program.sh -E pe.+ fruits-9137.txt
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_pear fruits-9137.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+ar fruits-9137.txt
[your_program] Logs from your program will appear here
[your_program] pear
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like apple\nnothing here\nplum and apple are tasty" | ./your_program.sh -o -E '(apple|plum)'
[your_program] Logs from your program will appear here
[your_program] apple
[your_program] plum
[your_program] apple
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "apple"
[tester::#BO4] ✓ Found line "plum"
[tester::#BO4] ✓ Found line "apple"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 horse and I saw 45 cat.\nNothing interesting today.\nLast week I saw 12 cats." | ./your_program.sh -o -E 'I saw \d+ (horse|cat)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 horse
[your_program] I saw 45 cat
[your_program] I saw 12 cats
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 horse"
[tester::#BO4] ✓ Found line "I saw 45 cat"
[tester::#BO4] ✓ Found line "I saw 12 cats"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "pear_plum_lemon" | ./your_program.sh -o -E '(lemon|plum|pear)'
[your_program] Logs from your program will appear here
[your_program] pear
[your_program] plum
[your_program] lemon
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "pear"
[tester::#SS2] ✓ Found line "plum"
[tester::#SS2] ✓ Found line "lemon"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 lions. Also, I see 4 pandas." | ./your_program.sh -o -E 'I see \d+ (lion|panda)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 lions
[your_program] I see 4 pandas
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 lions"
[tester::#SS2] ✓ Found line "I see 4 pandas"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "banana_suffix" | ./your_program.sh -o -E '^banana'
[your_program] Logs from your program will appear here
[your_program] banana
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "banana"
[tester::#CJ0] $ echo -ne "prefix_banana" | ./your_program.sh -o -E '^banana'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "apple\n!@#$\nstrawberry\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] apple
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "apple"
[tester::#PZ6] ✓ Found line "strawberry"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\ntiger\nitaly\nhorse\nspain" | ./your_program.sh -E '(tiger|horse)'
[your_program] Logs from your program will appear here
[your_program] tiger
[your_program] horse
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "tiger"
[tester::#PZ6] ✓ Found line "horse"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(tiger|horse)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 raspberry\nINVALID\nLOG 20 broccoli\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (raspberry|broccoli)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 raspberry
[your_program] LOG 20 broccoli
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 raspberry"
[tester::#PZ6] ✓ Found line "LOG 20 broccoli"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "pineapple_suffix" | ./your_program.sh -E '^pineapple'
[your_program] pineapple_suffix
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "pineapple_suffix"
[tester::#KU5] $ echo -ne "prefix_pineapple" | ./your_program.sh -E '^pineapple'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] $ echo -ne "ltest" | ./your_program.sh -E '[lemon]'
[your_program] Logs from your program will appear here
[your_program] ltest
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "ltest"
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] goøö0Ogol
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[your_program] act
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'apple_grape' | ./your_program.sh -E 'grape$'
[your_program] Logs from your program will appear here
[your_program] apple_grape
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'grape_apple' | ./your_program.sh -E 'grape$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'mango' | ./your_program.sh -E '^mango$'
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'mango_mango' | ./your_program.sh -E '^mango$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'blueberry_pineapple' | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[your_program] blueberry_pineapple
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'pineapple_blueberry' | ./your_program.sh -E '^blueberry'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] orange
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'e' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[your_program] e
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'ebc' | ./your_program.sh -E '[orange]'
[your_program] Logs from your program will appear here
[your_program] ebc
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'apple' | ./your_program.sh -E '[bcdfg]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[strawberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'mango' | ./your_program.sh -E '\w'
[your_program] mango
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'ORANGE' | ./your_program.sh -E '\w'
[your_program] ORANGE
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '897' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 897
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '+=#_×-=' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] +=#_×-=
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '%#+=÷-' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] 123
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
Disabling highlighting

Auto highlighting option

log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 21.1 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/grep.dir/src/main.cpp.o
[compile] [100%] Linking CXX executable grep
[compile] [100%] Built target grep
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#NA5] Running tests for Stage #NA5 (Highlighting - Auto highlighting option)
[tester::#NA5] $ echo -ne "mango" | ./your_program.sh --color=always -E '\w+' | cat
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#NA5] ✓ Received exit code 0.
[tester::#NA5] ✓ Found line "mango"
[tester::#NA5] ✓ All matches in the line "mango" are highlighted
[tester::#NA5] $ echo -ne "monkey in the wild\nrabbit in the air" | ./your_program.sh --color=always -E '(monkey|rabbit)'
[your_program] Logs from your program will appear here
[your_program] monkey in the wild
[your_program] rabbit in the air
[tester::#NA5] ✓ Received exit code 0.
[tester::#NA5] ✓ Found line "monkey in the wild"
[tester::#NA5] ✓ Found line "rabbit in the air"
[tester::#NA5] ✓ Stdout contains 2 expected lines in order
[tester::#NA5] ✓ All matches in the line "monkey in the wild" are highlighted
[tester::#NA5] ✓ All matches in the line "rabbit in the air" are highlighted
[tester::#NA5] $ echo -ne "123mango" | ./your_program.sh --color=never -E '\d+' | cat
[your_program] Logs from your program will appear here
[your_program] 123mango
[tester::#NA5] ✓ Received exit code 0.
[tester::#NA5] ✓ Found line "123mango"
[tester::#NA5] ✓ Line "123mango" is not highlighted
[tester::#NA5] $ echo -ne "I love mango" | ./your_program.sh --color=never -E 'mango'
[your_program] Logs from your program will appear here
[your_program] I love mango
[tester::#NA5] ✓ Received exit code 0.
[tester::#NA5] ✓ Found line "I love mango"
[tester::#NA5] ✓ Line "I love mango" is not highlighted
[tester::#NA5] $ echo -ne "prefix_strawberry" | ./your_program.sh --color=auto -E 'strawberry$' | cat
[your_program] Logs from your program will appear here
[your_program] prefix_strawberry
[tester::#NA5] ✓ Received exit code 0.
[tester::#NA5] ✓ Found line "prefix_strawberry"
[tester::#NA5] ✓ Line "prefix_strawberry" is not highlighted
[tester::#NA5] $ echo -ne "The rabbit runs fast" | ./your_program.sh --color=auto -E 'rabbit'
[your_program] Logs from your program will appear here
[your_program] The rabbit runs fast
[tester::#NA5] ✓ Received exit code 0.
[tester::#NA5] ✓ Found line "The rabbit runs fast"
[tester::#NA5] ✓ All matches in the line "The rabbit runs fast" are highlighted
[tester::#NA5] $ echo -ne "no numbers here" | ./your_program.sh --color=auto -E '\d'
[your_program] Logs from your program will appear here
[tester::#NA5] ✓ Received exit code 1.
[tester::#NA5] ✓ No output found
[tester::#NA5] Test passed.
[tester::#JK4] Running tests for Stage #JK4 (Highlighting - Disabling highlighting)
[tester::#JK4] $ echo -ne "1fox" | ./your_program.sh --color=never -E '\d' | cat
[your_program] 1fox
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "1fox"
[tester::#JK4] ✓ Line "1fox" is not highlighted
[tester::#JK4] $ echo -ne "cat" | ./your_program.sh --color=never -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 1.
[tester::#JK4] ✓ No output found
[tester::#JK4] $ echo -ne "banana_suffix" | ./your_program.sh --color=never -E '^banana' | cat
[your_program] Logs from your program will appear here
[your_program] banana_suffix
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "banana_suffix"
[tester::#JK4] ✓ Line "banana_suffix" is not highlighted
[tester::#JK4] $ echo -ne "prefix_mango" | ./your_program.sh --color=never -E '^mango' | cat
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 1.
[tester::#JK4] ✓ No output found
[tester::#JK4] $ echo -ne "doooog" | ./your_program.sh --color=never -E 'do+g' | cat
[your_program] doooog
[your_program] Logs from your program will appear here
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "doooog"
[tester::#JK4] ✓ Line "doooog" is not highlighted
[tester::#JK4] $ echo -ne "It's raining fox and cat\nIt's raining cat and fox" | ./your_program.sh --color=never -E '(fox|cat)' | cat
[your_program] Logs from your program will appear here
[your_program] It's raining fox and cat
[your_program] It's raining cat and fox
[tester::#JK4] ✓ Received exit code 0.
[tester::#JK4] ✓ Found line "It's raining fox and cat"
[tester::#JK4] ✓ Found line "It's raining cat and fox"
[tester::#JK4] ✓ Stdout contains 2 expected lines in order
[tester::#JK4] ✓ Line "It's raining fox and cat" is not highlighted
[tester::#JK4] ✓ Line "It's raining cat and fox" is not highlighted
[tester::#JK4] Test passed.
[tester::#WG2] Running tests for Stage #WG2 (Highlighting - Highlighting in multiple lines)
[tester::#WG2] $ echo -ne "a1b2c3\nno digits here\n456def" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] a1b2c3
[your_program] 456def
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "a1b2c3"
[tester::#WG2] ✓ Found line "456def"
[tester::#WG2] ✓ Stdout contains 2 expected lines in order
[tester::#WG2] ✓ All matches in the line "a1b2c3" are highlighted
[tester::#WG2] ✓ All matches in the line "456def" are highlighted
[tester::#WG2] $ echo -ne "elephant_fox_giraffe\nno_animal_here\nfox and giraffe" | ./your_program.sh --color=always -E '(fox|giraffe|elephant)' | cat
[your_program] Logs from your program will appear here
[your_program] elephant_fox_giraffe
[your_program] fox and giraffe
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "elephant_fox_giraffe"
[tester::#WG2] ✓ Found line "fox and giraffe"
[tester::#WG2] ✓ Stdout contains 2 expected lines in order
[tester::#WG2] ✓ All matches in the line "elephant_fox_giraffe" are highlighted
[tester::#WG2] ✓ All matches in the line "fox and giraffe" are highlighted
[tester::#WG2] $ echo -ne "orange\nfox\nbroccoli" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#WG2] ✓ Received exit code 1.
[tester::#WG2] ✓ No output found
[tester::#WG2] $ echo -ne "xxyyzz\nab cd ef\napple" | ./your_program.sh --color=always -E '\w\w' | cat
[your_program] Logs from your program will appear here
[your_program] xxyyzz
[your_program] ab cd ef
[your_program] apple
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "xxyyzz"
[tester::#WG2] ✓ Found line "ab cd ef"
[tester::#WG2] ✓ Found line "apple"
[tester::#WG2] ✓ Stdout contains 3 expected lines in order
[tester::#WG2] ✓ All matches in the line "xxyyzz" are highlighted
[tester::#WG2] ✓ All matches in the line "ab cd ef" are highlighted
[tester::#WG2] ✓ All matches in the line "apple" are highlighted
[tester::#WG2] $ echo -ne "$$##@@\n!@#$%^\n+++---" | ./your_program.sh --color=always -E '\w' | cat
[your_program] Logs from your program will appear here
[tester::#WG2] ✓ Received exit code 1.
[tester::#WG2] ✓ No output found
[tester::#WG2] $ echo -ne "I see 3 onions. Also, I see 4 broccolis.\nI ate 10 broccoli today" | ./your_program.sh --color=always -E 'I see \d+ (broccoli|onion)s?' | cat
[your_program] Logs from your program will appear here
[your_program] I see 3 onions. Also, I see 4 broccolis.
[tester::#WG2] ✓ Received exit code 0.
[tester::#WG2] ✓ Found line "I see 3 onions. Also, I see 4 broccolis."
[tester::#WG2] ✓ All matches in the line "I see 3 onions. Also, I see 4 broccolis." are highlighted
[tester::#WG2] Test passed.
[tester::#EQ0] Running tests for Stage #EQ0 (Highlighting - Highlighting multiple matches)
[tester::#EQ0] $ echo -ne "a1b2c3" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] a1b2c3
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "a1b2c3"
[tester::#EQ0] ✓ All matches in the line "a1b2c3" are highlighted
[tester::#EQ0] $ echo -ne "wolf_rabbit_panda" | ./your_program.sh --color=always -E '(rabbit|panda|wolf)' | cat
[your_program] Logs from your program will appear here
[your_program] wolf_rabbit_panda
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "wolf_rabbit_panda"
[tester::#EQ0] ✓ All matches in the line "wolf_rabbit_panda" are highlighted
[tester::#EQ0] $ echo -ne "raspberry" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#EQ0] ✓ Received exit code 1.
[tester::#EQ0] ✓ No output found
[tester::#EQ0] $ echo -ne "xxyyzz" | ./your_program.sh --color=always -E '\w\w' | cat
[your_program] Logs from your program will appear here
[your_program] xxyyzz
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "xxyyzz"
[tester::#EQ0] ✓ All matches in the line "xxyyzz" are highlighted
[tester::#EQ0] $ echo -ne "$$##@@" | ./your_program.sh --color=always -E '\w' | cat
[your_program] Logs from your program will appear here
[tester::#EQ0] ✓ Received exit code 1.
[tester::#EQ0] ✓ No output found
[tester::#EQ0] $ echo -ne "I see 3 tomatos. Also, I see 4 carrots." | ./your_program.sh --color=always -E 'I see \d+ (carrot|tomato)s?' | cat
[your_program] Logs from your program will appear here
[your_program] I see 3 tomatos. Also, I see 4 carrots.
[tester::#EQ0] ✓ Received exit code 0.
[tester::#EQ0] ✓ Found line "I see 3 tomatos. Also, I see 4 carrots."
[tester::#EQ0] ✓ All matches in the line "I see 3 tomatos. Also, I see 4 carrots." are highlighted
[tester::#EQ0] Test passed.
[tester::#BM2] Running tests for Stage #BM2 (Highlighting - Highlighting a single match)
[tester::#BM2] $ echo -ne "only1digit" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[your_program] only1digit
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "only1digit"
[tester::#BM2] ✓ All matches in the line "only1digit" are highlighted
[tester::#BM2] $ echo -ne "orange" | ./your_program.sh --color=always -E '\d' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "orange_suffix" | ./your_program.sh --color=always -E '^orange' | cat
[your_program] Logs from your program will appear here
[your_program] orange_suffix
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "orange_suffix"
[tester::#BM2] ✓ All matches in the line "orange_suffix" are highlighted
[tester::#BM2] $ echo -ne "prefix_strawberry" | ./your_program.sh --color=always -E '^strawberry' | cat
[your_program] Logs from your program will appear here
[tester::#BM2] ✓ Received exit code 1.
[tester::#BM2] ✓ No output found
[tester::#BM2] $ echo -ne "caaaat" | ./your_program.sh --color=always -E 'ca+t' | cat
[your_program] Logs from your program will appear here
[your_program] caaaat
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "caaaat"
[tester::#BM2] ✓ All matches in the line "caaaat" are highlighted
[tester::#BM2] $ echo -ne "I see 42 dogs" | ./your_program.sh --color=always -E '^I see \d+ (cat|dog)s?$' | cat
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#BM2] ✓ Received exit code 0.
[tester::#BM2] ✓ Found line "I see 42 dogs"
[tester::#BM2] ✓ All matches in the line "I see 42 dogs" are highlighted
[tester::#BM2] Test passed.
[tester::#XE5] Running tests for Stage #XE5 (Backreferences - Nested Backreferences)
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and cat"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[your_program] "cat and cat" is the same as "cat and cat"
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"cat and cat" is the same as "cat and dog"' | ./your_program.sh -E '("(cat) and \2") is the same as \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep 101 is doing grep 101 times, and again grep 101 times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times, and again grep 101 times
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '$?! 101 is doing $?! 101 times, and again $?! 101 times' | ./your_program.sh -E '((\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'grep yes is doing grep yes times, and again grep yes times' | ./your_program.sh -E '((\w\w\w\w) (\d\d\d)) is doing \2 \3 times, and again \1 times'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not efg, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg, abc, or def
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'efg-hij is efg-hij, not klm, efg, or hij' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'abc-def is abc-def, not xyz, abc, or def' | ./your_program.sh -E '(([abc]+)-([def]+)) is \1, not ([^xyz]+), \2, or \3'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((\w+) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[your_program] apple pie is made of apple and pie. love apple pie
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'pineapple pie is made of apple and pie. love apple pie' | ./your_program.sh -E '^((apple) (\w+)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'apple pie is made of apple and pie. love apple pies' | ./your_program.sh -E '^((\w+) (pie)) is made of \2 and \3. love \1$'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[your_program] "howwdy hey there" is made up of "howwdy" and "hey". howwdy hey there
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n '"hody hey there" is made up of "hody" and "hey". hody hey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n '"howwdy heeey there" is made up of "howwdy" and "heeey". howwdy heeey there' | ./your_program.sh -E '"((how+dy) (he?y) there)" is made up of "\2" and "\3". \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] $ echo -n 'cat and fish, cat with fish, cat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish, cat and fish
[tester::#XE5] ✓ Received exit code 0.
[tester::#XE5] $ echo -n 'bat and fish, bat with fish, bat and fish' | ./your_program.sh -E '((c.t|d.g) and (f..h|b..d)), \2 with \3, \1'
[your_program] Logs from your program will appear here
[tester::#XE5] ✓ Received exit code 1.
[tester::#XE5] Test passed.
[tester::#TG1] Running tests for Stage #TG1 (Backreferences - Multiple Backreferences)
[tester::#TG1] $ echo -n '3 red squares and 3 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[your_program] 3 red squares and 3 red circles
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '3 red squares and 4 red circles' | ./your_program.sh -E '(\d+) (\w+) squares and \1 \2 circles'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep 101 is doing grep 101 times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[your_program] grep 101 is doing grep 101 times
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n '$?! 101 is doing $?! 101 times' | ./your_program.sh -E '(\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'grep yes is doing grep yes times' | ./your_program.sh -E '(\w\w\w\w) (\d\d\d) is doing \1 \2 times'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[your_program] abc-def is abc-def, not efg
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'efg-hij is efg-hij, not efg' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'abc-def is abc-def, not xyz' | ./your_program.sh -E '([abc]+)-([def]+) is \1-\2, not [^xyz]+'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pie' | ./your_program.sh -E '^(\w+) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[your_program] apple pie, apple and pie
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'pineapple pie, pineapple and pie' | ./your_program.sh -E '^(apple) (\w+), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'apple pie, apple and pies' | ./your_program.sh -E '^(\w+) (pie), \1 and \2$'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[your_program] howwdy hey there, howwdy hey
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'hody hey there, howwdy hey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'howwdy heeey there, howwdy heeey' | ./your_program.sh -E '(how+dy) (he?y) there, \1 \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] $ echo -n 'cat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[your_program] cat and fish, cat with fish
[tester::#TG1] ✓ Received exit code 0.
[tester::#TG1] $ echo -n 'bat and fish, cat with fish' | ./your_program.sh -E '(c.t|d.g) and (f..h|b..d), \1 with \2'
[your_program] Logs from your program will appear here
[tester::#TG1] ✓ Received exit code 1.
[tester::#TG1] Test passed.
[tester::#SB5] Running tests for Stage #SB5 (Backreferences - Single Backreference)
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(cat) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat and cat' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[your_program] cat and cat
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat and dog' | ./your_program.sh -E '(\w+) and \1'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] $ echo -n 'cat is cat, not dog' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[your_program] cat is cat, not dog
[tester::#SB5] ✓ Received exit code 0.
[tester::#SB5] $ echo -n 'cat is c@t, not d0g' | ./your_program.sh -E '^([act]+) is \1, not [^xyz]+$'
[your_program] Logs from your program will appear here
[tester::#SB5] ✓ Received exit code 1.
[tester::#SB5] Test passed.
[tester::#UG0] Running tests for Stage #UG0 (Quantifiers - Match between n and m times)
[tester::#UG0] $ echo -n 'potatooo_soup' | ./your_program.sh -E 'potato{2,4}_soup'
[your_program] Logs from your program will appear here
[your_program] potatooo_soup
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'potato_soup' | ./your_program.sh -E 'potato{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'potatooooo_soup' | ./your_program.sh -E 'potato{2,4}_soup'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] $ echo -n 'panda480' | ./your_program.sh -E 'panda\d{2,4}'
[your_program] Logs from your program will appear here
[your_program] panda480
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'orange,_ab' | ./your_program.sh -E 'orange,\w{1,3}'
[your_program] Logs from your program will appear here
[your_program] orange,_ab
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'horsepandaelephant' | ./your_program.sh -E '(panda|elephant|horse){2,3}'
[your_program] Logs from your program will appear here
[your_program] horsepandaelephant
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n 'pineappleaei' | ./your_program.sh -E 'pineapple[aeiou]{2,4}'
[your_program] Logs from your program will appear here
[your_program] pineappleaei
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '2024-10-29 19:49 LOG DEBUG token_created' | ./your_program.sh -E '^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[your_program] 2024-10-29 19:49 LOG DEBUG token_created
[tester::#UG0] ✓ Received exit code 0.
[tester::#UG0] $ echo -n '7:15:3:6 WARN INFO token_created' | ./your_program.sh -E '^\d{1,2}:\d{1,2}:\d{1,2}:\d{2,3} LOG (INFO|DEBUG) \w+$'
[your_program] Logs from your program will appear here
[tester::#UG0] ✓ Received exit code 1.
[tester::#UG0] Test passed.
[tester::#HK3] Running tests for Stage #HK3 (Quantifiers - Match at least n times)
[tester::#HK3] $ echo -n 'cherryyy' | ./your_program.sh -E 'cherryy{2,}'
[your_program] Logs from your program will appear here
[your_program] cherryyy
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'cherryyyyy' | ./your_program.sh -E 'cherryy{2,}'
[your_program] Logs from your program will appear here
[your_program] cherryyyyy
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'wolf8017' | ./your_program.sh -E 'wolf\d{3,}'
[your_program] Logs from your program will appear here
[your_program] wolf8017
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'tomato,_tag' | ./your_program.sh -E 'tomato,\w{2,}'
[your_program] Logs from your program will appear here
[your_program] tomato,_tag
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n 'pumpkintomatoasparaguspumpkin' | ./your_program.sh -E '(tomato|asparagus|pumpkin){3,}'
[your_program] Logs from your program will appear here
[your_program] pumpkintomatoasparaguspumpkin
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '13:11 LOG DEBUG token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[your_program] 13:11 LOG DEBUG token_created
[tester::#HK3] ✓ Received exit code 0.
[tester::#HK3] $ echo -n '02:32 LOG OK token_created' | ./your_program.sh -E '^\d{2}:\d{2} LOG \w{3,} \w+$'
[your_program] Logs from your program will appear here
[tester::#HK3] ✓ Received exit code 1.
[tester::#HK3] Test passed.
[tester::#WY9] Running tests for Stage #WY9 (Quantifiers - Match exactly n times)
[tester::#WY9] $ echo -n 'lemonnn' | ./your_program.sh -E 'lemonn{2}'
[your_program] Logs from your program will appear here
[your_program] lemonnn
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'tiger323' | ./your_program.sh -E 'tiger\d{3}'
[your_program] Logs from your program will appear here
[your_program] tiger323
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'pea,_hi' | ./your_program.sh -E 'pea,\w{4}'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] $ echo -n 'cattiger' | ./your_program.sh -E '(tiger|cat){2}'
[your_program] Logs from your program will appear here
[your_program] cattiger
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n 'lemonuoi' | ./your_program.sh -E 'lemon[aeiou]{3}'
[your_program] lemonuoi
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2024-04-08 19:46 lemon' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (lemon|pea)$'
[your_program] Logs from your program will appear here
[your_program] 2024-04-08 19:46 lemon
[tester::#WY9] ✓ Received exit code 0.
[tester::#WY9] $ echo -n '2024-10-4 8:28 lemon' | ./your_program.sh -E '^\d{4}-\d{2}-\d{2} \d{2}:\d{2} (lemon|pea)$'
[your_program] Logs from your program will appear here
[tester::#WY9] ✓ Received exit code 1.
[tester::#WY9] Test passed.
[tester::#AI9] Running tests for Stage #AI9 (Quantifiers - Match zero or more times)
[tester::#AI9] $ echo -n 'plum' | ./your_program.sh -E 'plum*'
[your_program] Logs from your program will appear here
[your_program] plum
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'plu' | ./your_program.sh -E 'plum*'
[your_program] Logs from your program will appear here
[your_program] plu
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'fox77rabbit' | ./your_program.sh -E 'fox\d*rabbit'
[your_program] Logs from your program will appear here
[your_program] fox77rabbit
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'carrot,_fresh' | ./your_program.sh -E 'carrot,\w*'
[your_program] Logs from your program will appear here
[your_program] carrot,_fresh
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'rabbitfoxfoxrabbit' | ./your_program.sh -E '(fox|rabbit)*'
[your_program] rabbitfoxfoxrabbit
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG INFO 43 plum' | ./your_program.sh -E '^LOG [FION]* \d+ (plum|carrot)$'
[your_program] Logs from your program will appear here
[your_program] LOG INFO 43 plum
[tester::#AI9] ✓ Received exit code 0.
[tester::#AI9] $ echo -n 'LOG info 54 plum' | ./your_program.sh -E '^LOG [FION]* \d+ (plum|carrot)$'
[your_program] Logs from your program will appear here
[tester::#AI9] ✓ Received exit code 1.
[tester::#AI9] Test passed.
[tester::#YX6] Running tests for Stage #YX6 (File Search - Recursive search)
[tester::#YX6] [setup] echo "grape" > "dir/fruits-5885.txt"
[tester::#YX6] [setup] echo "pear" >> "dir/fruits-5885.txt"
[tester::#YX6] [setup] echo "pumpkin" > "dir/subdir/vegetables-5147.txt"
[tester::#YX6] [setup] echo "celery" >> "dir/subdir/vegetables-5147.txt"
[tester::#YX6] [setup] echo "cauliflower" >> "dir/subdir/vegetables-5147.txt"
[tester::#YX6] [setup] echo "lettuce" > "dir/vegetables-5177.txt"
[tester::#YX6] [setup] echo "cabbage" >> "dir/vegetables-5177.txt"
[tester::#YX6] [setup] echo "cucumber" >> "dir/vegetables-5177.txt"
[tester::#YX6] $ ./your_program.sh -r -E .+er dir/
[your_program] Logs from your program will appear here
[your_program] dir/vegetables-5177.txt:cucumber
[your_program] dir/subdir/vegetables-5147.txt:celery
[your_program] dir/subdir/vegetables-5147.txt:cauliflower
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 3 expected lines
[tester::#YX6] $ ./your_program.sh -r -E .+ar dir/
[your_program] dir/fruits-5885.txt:pear
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 0.
[tester::#YX6] ✓ Stdout contains 1 expected line
[tester::#YX6] $ ./your_program.sh -r -E missing_fruit_grape dir/
[your_program] Logs from your program will appear here
[tester::#YX6] ✓ Received exit code 1.
[tester::#YX6] ✓ No output found
[tester::#YX6] Test passed.
[tester::#IS6] Running tests for Stage #IS6 (File Search - Search multiple files)
[tester::#IS6] [setup] echo "blackberry" > "fruits-6863.txt"
[tester::#IS6] [setup] echo "mango" >> "fruits-6863.txt"
[tester::#IS6] [setup] echo "onion" > "vegetables-5801.txt"
[tester::#IS6] [setup] echo "carrot" >> "vegetables-5801.txt"
[tester::#IS6] $ ./your_program.sh -E bl.+$ fruits-6863.txt vegetables-5801.txt
[your_program] Logs from your program will appear here
[your_program] fruits-6863.txt:blackberry
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] $ ./your_program.sh -E missing_vegetable_onion fruits-6863.txt vegetables-5801.txt
[your_program] Logs from your program will appear here
[tester::#IS6] ✓ Received exit code 1.
[tester::#IS6] ✓ No output found
[tester::#IS6] $ ./your_program.sh -E onion fruits-6863.txt vegetables-5801.txt
[your_program] Logs from your program will appear here
[your_program] vegetables-5801.txt:onion
[tester::#IS6] ✓ Received exit code 0.
[tester::#IS6] ✓ Stdout contains 1 expected line
[tester::#IS6] Test passed.
[tester::#OL9] Running tests for Stage #OL9 (File Search - Search a multi-line file)
[tester::#OL9] [setup] echo "mango" > "fruits-8836.txt"
[tester::#OL9] [setup] echo "blackberry" >> "fruits-8836.txt"
[tester::#OL9] [setup] echo "blueberry" >> "fruits-8836.txt"
[tester::#OL9] [setup] echo "strawberry" >> "fruits-8836.txt"
[tester::#OL9] $ ./your_program.sh -E .+berry fruits-8836.txt
[your_program] Logs from your program will appear here
[your_program] blackberry
[your_program] blueberry
[your_program] strawberry
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 3 expected lines
[tester::#OL9] $ ./your_program.sh -E missing_vegetable_onion fruits-8836.txt
[your_program] Logs from your program will appear here
[tester::#OL9] ✓ Received exit code 1.
[tester::#OL9] ✓ No output found
[tester::#OL9] $ ./your_program.sh -E mango fruits-8836.txt
[your_program] Logs from your program will appear here
[your_program] mango
[tester::#OL9] ✓ Received exit code 0.
[tester::#OL9] ✓ Stdout contains 1 expected line
[tester::#OL9] Test passed.
[tester::#DR5] Running tests for Stage #DR5 (File Search - Search a single-line file)
[tester::#DR5] [setup] echo "cherry" > "fruits-7436.txt"
[tester::#DR5] $ ./your_program.sh -E che.+ fruits-7436.txt
[your_program] Logs from your program will appear here
[your_program] cherry
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] $ ./your_program.sh -E missing_fruit_cherry fruits-7436.txt
[your_program] Logs from your program will appear here
[tester::#DR5] ✓ Received exit code 1.
[tester::#DR5] ✓ No output found
[tester::#DR5] $ ./your_program.sh -E .+rry fruits-7436.txt
[your_program] Logs from your program will appear here
[your_program] cherry
[tester::#DR5] ✓ Received exit code 0.
[tester::#DR5] ✓ Stdout contains 1 expected line
[tester::#DR5] Test passed.
[tester::#BO4] Running tests for Stage #BO4 (Multiple Matches - Process multiple input lines)
[tester::#BO4] $ echo -ne "a1b\nno digits here\n2c3d" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "1"
[tester::#BO4] ✓ Found line "2"
[tester::#BO4] ✓ Found line "3"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "I like blueberry\nnothing here\nlemon and blueberry are tasty" | ./your_program.sh -o -E '(blueberry|lemon)'
[your_program] Logs from your program will appear here
[your_program] blueberry
[your_program] lemon
[your_program] blueberry
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Found line "lemon"
[tester::#BO4] ✓ Found line "blueberry"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "abc\ndef\nghi" | ./your_program.sh -o -E 'XYZ123'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] $ echo -ne "dogdogdog\nelephant\ncat-cat-dog" | ./your_program.sh -o -E 'cat'
[your_program] Logs from your program will appear here
[your_program] cat
[your_program] cat
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Found line "cat"
[tester::#BO4] ✓ Stdout contains 2 expected lines in order
[tester::#BO4] $ echo -ne "Yesterday I saw 3 elephant and I saw 45 horse.\nNothing interesting today.\nLast week I saw 12 horses." | ./your_program.sh -o -E 'I saw \d+ (elephant|horse)s?'
[your_program] Logs from your program will appear here
[your_program] I saw 3 elephant
[your_program] I saw 45 horse
[your_program] I saw 12 horses
[tester::#BO4] ✓ Received exit code 0.
[tester::#BO4] ✓ Found line "I saw 3 elephant"
[tester::#BO4] ✓ Found line "I saw 45 horse"
[tester::#BO4] ✓ Found line "I saw 12 horses"
[tester::#BO4] ✓ Stdout contains 3 expected lines in order
[tester::#BO4] $ echo -ne "today is sunny\nno rains here\ntomorrow maybe rainy" | ./your_program.sh -o -E 'cats and dogs'
[your_program] Logs from your program will appear here
[tester::#BO4] ✓ Received exit code 1.
[tester::#BO4] ✓ No output found
[tester::#BO4] Test passed.
[tester::#SS2] Running tests for Stage #SS2 (Multiple Matches - Print multiple matches)
[tester::#SS2] $ echo -ne "a1b2c3" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[your_program] 2
[your_program] 3
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "1"
[tester::#SS2] ✓ Found line "2"
[tester::#SS2] ✓ Found line "3"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "orange_plum_lemon" | ./your_program.sh -o -E '(lemon|plum|orange)'
[your_program] Logs from your program will appear here
[your_program] orange
[your_program] plum
[your_program] lemon
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "orange"
[tester::#SS2] ✓ Found line "plum"
[tester::#SS2] ✓ Found line "lemon"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "xx, yy, zz" | ./your_program.sh -o -E '\w\w'
[your_program] Logs from your program will appear here
[your_program] xx
[your_program] yy
[your_program] zz
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "xx"
[tester::#SS2] ✓ Found line "yy"
[tester::#SS2] ✓ Found line "zz"
[tester::#SS2] ✓ Stdout contains 3 expected lines in order
[tester::#SS2] $ echo -ne "##$$%" | ./your_program.sh -o -E '\w'
[your_program] Logs from your program will appear here
[tester::#SS2] ✓ Received exit code 1.
[tester::#SS2] ✓ No output found
[tester::#SS2] $ echo -ne "I see 3 foxs. Also, I see 4 tigers." | ./your_program.sh -o -E 'I see \d+ (fox|tiger)s?'
[your_program] Logs from your program will appear here
[your_program] I see 3 foxs
[your_program] I see 4 tigers
[tester::#SS2] ✓ Received exit code 0.
[tester::#SS2] ✓ Found line "I see 3 foxs"
[tester::#SS2] ✓ Found line "I see 4 tigers"
[tester::#SS2] ✓ Stdout contains 2 expected lines in order
[tester::#SS2] Test passed.
[tester::#CJ0] Running tests for Stage #CJ0 (Multiple Matches - Print single match)
[tester::#CJ0] $ echo -ne "only1digit" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[your_program] 1
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "1"
[tester::#CJ0] $ echo -ne "cherry" | ./your_program.sh -o -E '\d'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "grape_suffix" | ./your_program.sh -o -E '^grape'
[your_program] Logs from your program will appear here
[your_program] grape
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "grape"
[tester::#CJ0] $ echo -ne "prefix_grape" | ./your_program.sh -o -E '^grape'
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 1.
[tester::#CJ0] ✓ No output found
[tester::#CJ0] $ echo -ne "cat" | ./your_program.sh -o -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "cat"
[tester::#CJ0] $ echo -ne "I see 42 dogs" | ./your_program.sh -o -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#CJ0] ✓ Received exit code 0.
[tester::#CJ0] ✓ Found line "I see 42 dogs"
[tester::#CJ0] Test passed.
[tester::#PZ6] Running tests for Stage #PZ6 (Printing Matches - Print multiple matching lines)
[tester::#PZ6] $ echo -ne "apple\nbanana123\ncherry\ndog456\nelephant" | ./your_program.sh -E '\d'
[your_program] banana123
[your_program] Logs from your program will appear here
[your_program] dog456
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "banana123"
[tester::#PZ6] ✓ Found line "dog456"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "apple\nbanana\ncherry\ndog" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "strawberry\n!@#$\npineapple\n+++\ntest123" | ./your_program.sh -E '\w+'
[your_program] Logs from your program will appear here
[your_program] strawberry
[your_program] pineapple
[your_program] test123
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "strawberry"
[tester::#PZ6] ✓ Found line "pineapple"
[tester::#PZ6] ✓ Found line "test123"
[tester::#PZ6] ✓ Stdout contains 3 expected lines in order
[tester::#PZ6] $ echo -ne "france\nelephant\nitaly\ngiraffe\nspain" | ./your_program.sh -E '(elephant|giraffe)'
[your_program] Logs from your program will appear here
[your_program] elephant
[your_program] giraffe
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "elephant"
[tester::#PZ6] ✓ Found line "giraffe"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] $ echo -ne "New York\nWashington D.C.\nAustin\nLos Angeles" | ./your_program.sh -E '(elephant|giraffe)'
[your_program] Logs from your program will appear here
[tester::#PZ6] ✓ Received exit code 1.
[tester::#PZ6] ✓ No output found
[tester::#PZ6] $ echo -ne "LOG 10 plum\nINVALID\nLOG 20 pea\nLOG 30 invalid" | ./your_program.sh -E '^LOG \d+ (plum|pea)$'
[your_program] Logs from your program will appear here
[your_program] LOG 10 plum
[your_program] LOG 20 pea
[tester::#PZ6] ✓ Received exit code 0.
[tester::#PZ6] ✓ Found line "LOG 10 plum"
[tester::#PZ6] ✓ Found line "LOG 20 pea"
[tester::#PZ6] ✓ Stdout contains 2 expected lines in order
[tester::#PZ6] Test passed.
[tester::#KU5] Running tests for Stage #KU5 (Printing Matches - Print a single matching line)
[tester::#KU5] $ echo -ne "banana123" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] banana123
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "banana123"
[tester::#KU5] $ echo -ne "cherry" | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "mango_suffix" | ./your_program.sh -E '^mango'
[your_program] Logs from your program will appear here
[your_program] mango_suffix
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "mango_suffix"
[tester::#KU5] $ echo -ne "prefix_mango" | ./your_program.sh -E '^mango'
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 1.
[tester::#KU5] ✓ No output found
[tester::#KU5] $ echo -ne "cat" | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "cat"
[tester::#KU5] $ echo -ne "otest" | ./your_program.sh -E '[orange]'
[your_program] otest
[your_program] Logs from your program will appear here
[tester::#KU5] ✓ Received exit code 0.
[tester::#KU5] ✓ Found line "otest"
[tester::#KU5] Test passed.
[tester::#ZM7] Running tests for Stage #ZM7 (Alternation)
[tester::#ZM7] $ echo -n 'a cat' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[your_program] a cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'a cog' | ./your_program.sh -E 'a (cat|dog)'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 1 cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 1 cat
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see 42 dogs' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[your_program] I see 42 dogs
[tester::#ZM7] ✓ Received exit code 0.
[tester::#ZM7] $ echo -n 'I see a cat' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] $ echo -n 'I see 2 dog3' | ./your_program.sh -E '^I see \d+ (cat|dog)s?$'
[your_program] Logs from your program will appear here
[tester::#ZM7] ✓ Received exit code 1.
[tester::#ZM7] Test passed.
[tester::#ZB3] Running tests for Stage #ZB3 (Wildcard)
[tester::#ZB3] $ echo -n 'cat' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'car' | ./your_program.sh -E 'c.t'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] $ echo -n 'goøö0Ogol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[your_program] goøö0Ogol
[tester::#ZB3] ✓ Received exit code 0.
[tester::#ZB3] $ echo -n 'gol' | ./your_program.sh -E 'g.+gol'
[your_program] Logs from your program will appear here
[tester::#ZB3] ✓ Received exit code 1.
[tester::#ZB3] Test passed.
[tester::#NY8] Running tests for Stage #NY8 (Match zero or one times)
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?t'
[your_program] cat
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'act' | ./your_program.sh -E 'ca?t'
[your_program] act
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'cat' | ./your_program.sh -E 'ca?a?t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#NY8] ✓ Received exit code 0.
[tester::#NY8] $ echo -n 'caat' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] $ echo -n 'cag' | ./your_program.sh -E 'ca?t'
[your_program] Logs from your program will appear here
[tester::#NY8] ✓ Received exit code 1.
[tester::#NY8] Test passed.
[tester::#FZ7] Running tests for Stage #FZ7 (Match one or more times)
[tester::#FZ7] $ echo -n 'cat' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[your_program] cat
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'caaats' | ./your_program.sh -E 'ca+at'
[your_program] Logs from your program will appear here
[your_program] caaats
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'act' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'ca' | ./your_program.sh -E 'ca+t'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] $ echo -n 'abc_123_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[your_program] abc_123_xyz
[tester::#FZ7] ✓ Received exit code 0.
[tester::#FZ7] $ echo -n 'abc_rst_xyz' | ./your_program.sh -E '^abc_\d+_xyz$'
[your_program] Logs from your program will appear here
[tester::#FZ7] ✓ Received exit code 1.
[tester::#FZ7] Test passed.
[tester::#AO7] Running tests for Stage #AO7 (End of string anchor)
[tester::#AO7] $ echo -n 'raspberry_pear' | ./your_program.sh -E 'pear$'
[your_program] Logs from your program will appear here
[your_program] raspberry_pear
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pear_raspberry' | ./your_program.sh -E 'pear$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] $ echo -n 'pineapple' | ./your_program.sh -E '^pineapple$'
[your_program] Logs from your program will appear here
[your_program] pineapple
[tester::#AO7] ✓ Received exit code 0.
[tester::#AO7] $ echo -n 'pineapple_pineapple' | ./your_program.sh -E '^pineapple$'
[your_program] Logs from your program will appear here
[tester::#AO7] ✓ Received exit code 1.
[tester::#AO7] Test passed.
[tester::#RR8] Running tests for Stage #RR8 (Start of string anchor)
[tester::#RR8] $ echo -n 'grape_apple' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[your_program] grape_apple
[tester::#RR8] ✓ Received exit code 0.
[tester::#RR8] $ echo -n 'apple_grape' | ./your_program.sh -E '^grape'
[your_program] Logs from your program will appear here
[tester::#RR8] ✓ Received exit code 1.
[tester::#RR8] Test passed.
[tester::#SH9] Running tests for Stage #SH9 (Combining Character Classes)
[tester::#SH9] $ echo -n 'sally has 3 apples' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[your_program] sally has 3 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 orange' | ./your_program.sh -E '\d apple'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 124 apples' | ./your_program.sh -E '\d\d\d apples'
[your_program] Logs from your program will appear here
[your_program] sally has 124 apples
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 12 apples' | ./your_program.sh -E '\d\\d\\d apples'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] $ echo -n 'sally has 3 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 3 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 4 dogs' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[your_program] sally has 4 dogs
[tester::#SH9] ✓ Received exit code 0.
[tester::#SH9] $ echo -n 'sally has 1 dog' | ./your_program.sh -E '\d \w\w\ws'
[your_program] Logs from your program will appear here
[tester::#SH9] ✓ Received exit code 1.
[tester::#SH9] Test passed.
[tester::#RK3] Running tests for Stage #RK3 (Negative Character Groups)
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^xyz]'
[your_program] Logs from your program will appear here
[your_program] apple
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'apple' | ./your_program.sh -E '[^abc]'
[your_program] apple
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] $ echo -n 'banana' | ./your_program.sh -E '[^anb]'
[your_program] Logs from your program will appear here
[tester::#RK3] ✓ Received exit code 1.
[tester::#RK3] $ echo -n 'orange' | ./your_program.sh -E '[^opq]'
[your_program] Logs from your program will appear here
[your_program] orange
[tester::#RK3] ✓ Received exit code 0.
[tester::#RK3] Test passed.
[tester::#TL6] Running tests for Stage #TL6 (Positive Character Groups)
[tester::#TL6] $ echo -n 'e' | ./your_program.sh -E '[grape]'
[your_program] Logs from your program will appear here
[your_program] e
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'ebc' | ./your_program.sh -E '[grape]'
[your_program] ebc
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 0.
[tester::#TL6] $ echo -n 'pear' | ./your_program.sh -E '[bcdf]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] $ echo -n '[]' | ./your_program.sh -E '[raspberry]'
[your_program] Logs from your program will appear here
[tester::#TL6] ✓ Received exit code 1.
[tester::#TL6] Test passed.
[tester::#MR9] Running tests for Stage #MR9 (Match word characters)
[tester::#MR9] $ echo -n 'raspberry' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] raspberry
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n 'BLUEBERRY' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] BLUEBERRY
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '649' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] 649
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '=+%_#×+' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[your_program] =+%_#×+
[tester::#MR9] ✓ Received exit code 0.
[tester::#MR9] $ echo -n '-#÷=%×' | ./your_program.sh -E '\w'
[your_program] Logs from your program will appear here
[tester::#MR9] ✓ Received exit code 1.
[tester::#MR9] Test passed.
[tester::#OQ2] Running tests for Stage #OQ2 (Match digits)
[tester::#OQ2] $ echo -n '123' | ./your_program.sh -E '\d'
[your_program] 123
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] $ echo -n 'apple' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[tester::#OQ2] ✓ Received exit code 1.
[tester::#OQ2] $ echo -n 'abc_0_xyz' | ./your_program.sh -E '\d'
[your_program] Logs from your program will appear here
[your_program] abc_0_xyz
[tester::#OQ2] ✓ Received exit code 0.
[tester::#OQ2] Test passed.
[tester::#CQ2] Running tests for Stage #CQ2 (Match a literal character)
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'd'
[your_program] Logs from your program will appear here
[your_program] dog
[tester::#CQ2] ✓ Received exit code 0.
[tester::#CQ2] $ echo -n 'dog' | ./your_program.sh -E 'f'
[your_program] Logs from your program will appear here
[tester::#CQ2] ✓ Received exit code 1.
[tester::#CQ2] Test passed.
喜欢这篇文章的人也看了
评论
隐私政策
0/500
滚动到此处加载评论...



