Skip to content

Multiple string matchers with an AND operator #1654

Answered by ehsandeep
rushter asked this question in Q&A
Discussion options

You must be logged in to vote

@rushter echo 'https://github.com/' | httpx --json -ms "Github" -ms "NON_EXISTENT_PATTERN" is right example to use, possibly not the best example I've shared in linked comment where I was looking for string and passed to -ms option but you don't need to mention the operator, if you've used multiple -ms option, they are treated with AND condition.

echo 'https://github.com/' | httpx --json -ms "Github" -ms "NON_EXISTENT_PATTERN"

Other ways to do the same with DSL filters like contains_all, contains_any

echo 'https://github.com/' | httpx --json -mdc 'contains_all(body,"GitHub", "XXXXXXX")'
echo 'https://github.com/' | httpx --json -mdc 'contains_any(body,"GitHub", "XXXXXXX")'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rushter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1653 on April 03, 2024 08:24.