Repository navigation
Closed
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.
Description
Description
In httpx v1.9.0, -mr (match regex) does not behave consistently with -er (extract regex) when using the same regex pattern against the same HTTP response.
The same regex is successfully extracted using -er, but -mr does not produce any match.
This behavior is not observed in httpx v1.6.3.
Steps to Reproduce
Test file
key=AKEBOSHI82HAKA123
Start server
python3 -m http.server 8001httpx v1.6.3 (working behavior)
-mr
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.6.3 -mr "AKEBOSHI[0-9A-Z]{6}"
http://127.0.0.1:8001/test.txt-er
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.6.3 -er "AKEBOSHI[0-9A-Z]{6}"
http://127.0.0.1:8001/test.txt [AKEBOSHI82HAKA123]-mr + -er
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.6.3 -mr "AKEBOSHI[0-9A-Z]{6}" -er "AKEBOSHI[0-9A-Z]{6}"
http://127.0.0.1:8001/test.txt [AKEBOSHI82HAKA123]httpx v1.9.0 (unexpected behavior)
-mr
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.9.0 -mr "AKEBOSHI[0-9A-Z]{6}"(no output)
-er
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.9.0 -er "AKEBOSHI[0-9A-Z]{6}"
http://127.0.0.1:8001/test.txt [AKEBOSHI82HAKA123]-mr + -er
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.9.0 -mr "AKEBOSHI[0-9A-Z]{6}" -er "AKEBOSHI[0-9A-Z]{6}"(no output)
Additional verification
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.9.0 -mr "AKEBOSHI"(no output)
echo "http://127.0.0.1:8001/test.txt" | ./httpx-v1.9.0 -er "AKEBOSHI"
http://127.0.0.1:8001/test.txt [AKEBOSHI82HAKA123]Expected behavior
If a regex is successfully matched/extracted from the response body, both:
-mrshould match the response-ershould extract the same pattern
Actual behavior
-ersuccessfully extracts matches from response body-mrdoes not match the same regex in v1.9.0- Behavior is consistent across regex and literal patterns
- No issue observed in v1.6.3
Notes
- Test environment is local (
python3 -m http.server) - Response body is confirmed valid and clean
- No encoding issues or hidden characters
- Fully reproducible on both versions
Metadata
Metadata
Assignees
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.
Activity
fix(runner): preserve case sensitivity for match-regex and filter-reg…
Merge pull request #2524 from ThryLox/fix/match-regex-case-sensitivity