-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support to access specific index from the array element #2106
Comments
I don't this is possible without implementing a custom parser, since https://github.com/Knetic/govaluate does not support index access syntax. We could eventually add an helper function like |
Since we have _1 etc suffixes, I assume we are already doing manual parsing. Worst case, changing that to regular array access syntax should not be complicated. It's more straight forward for the users and maybe we'll change the underlying library later on to something that supports more complex evaluations out of the box. |
|
May my contribution is help to fix this issue.. ? PR reference: projectdiscovery/dsl#50 |
@Esonhugh |
Such kind of template in question may need more support. Such as supporting the array for regex multi results. But it helps solving the condition in #2106 (comment). index() can get the index of strings slice (more common type of a string array). refer: https://github.com/projectdiscovery/dsl/blob/156ef2a49eb95f2f9c5757f161c21033a2221a61/dsl.go#L98 :type assert doc: https://nuclei.projectdiscovery.io/templating-guide/helper-functions/ And I enhanced the len() func to help people to get the whole length of strings slice or other type make something like getting last 2 line in []line possible. |
Note: confirm if accessing a specific index from the array element is possible. if yes, update the docs, if not we can look into adding support for it.
The text was updated successfully, but these errors were encountered: