Skip to content
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

Operation request: Operate only on a section of the input #427

Closed
n1474335 opened this issue Nov 20, 2018 · 3 comments
Closed

Operation request: Operate only on a section of the input #427

n1474335 opened this issue Nov 20, 2018 · 3 comments

Comments

@n1474335
Copy link
Member

Summary

A Flow Control operation to specify that the subsequent operation is only run on a subsection of the input, rather than the whole thing.

The subsection could be defined using a regular expression or offsets.

Instead of the subsection only applying to one operation, the existing 'Merge' operation could be used to define the point at which the entire input is processed again.

Example

Input

123test456

Recipe

Subsection (or some other more suitable name)
    Section (regex): .{3}([a-z]+).{3}
To Braille

Output

123⠞⠑⠎⠞456
@n1474335
Copy link
Member Author

Closed in #467

@unluddite
Copy link

Hi,

I'm not sure how to use this Recipe to, say, extract numbers from some lines of input and sum them up. Am I misunderstanding how this is meant to work?

https://gchq.github.io/CyberChef/#recipe=Subsection('%5ENum%20%3D%20(%5C%5Cd%2B)',true,true,false)Merge()Sum('Line%20feed')&input=TnVtID0gMTAKTnVtID0gMjAKTnVtID0gMzAK

Thanks!

@n1073645
Copy link
Contributor

Hello,

For the functionality you are looking for I have come up with the following solution:

https://gchq.github.io/CyberChef/#recipe=Regular_expression('User%20defined','%5C%5Cd%2B',true,true,false,false,false,false,'List%20matches')Sum('Line%20feed')&input=TnVtID0gMTAKTnVtID0gMjAKTnVtID0gMzAK

BRAVO68WEB pushed a commit to BRAVO68WEB/CyberChef that referenced this issue May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants