How do I match multiple lines of code? #690
Answered
by
HerringtonDarkholme
raffomania
asked this question in
Q&A
-
I would like to match two lines from a python codebase using FastAPI: router = APIRouter(prefix="/user", dependencies=[Depends(get_current_user)])
tags = ["user"] I've tried to use this command: Resulting in the following error:
In the playground, using the following pattern:
can be parsed, but it doesn't match the code above. What is the correct syntax for matching newlines and/or whitespace? |
Beta Was this translation helpful? Give feedback.
Answered by
HerringtonDarkholme
Nov 1, 2023
Replies: 1 comment 1 reply
-
Hi, thanks for giving ast-grep a try. It is not possible to match two nodes at one time now. Alternatively, you can try relational rule https://ast-grep.github.io/guide/rule-config/relational-rule.html |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
raffomania
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for giving ast-grep a try.
It is not possible to match two nodes at one time now.
Alternatively, you can try relational rule https://ast-grep.github.io/guide/rule-config/relational-rule.html