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

grep needs -P to accept regex with lookahead #48

Closed
amerkay opened this issue Jun 7, 2020 · 4 comments · Fixed by #51
Closed

grep needs -P to accept regex with lookahead #48

amerkay opened this issue Jun 7, 2020 · 4 comments · Fixed by #51

Comments

@amerkay
Copy link

amerkay commented Jun 7, 2020

Great work.

I'm trying to use your orb, but my use case needs negative lookahead in regex, which needs -P to be added to the grep command. See https://stackoverflow.com/a/9198987.

Keep it up :)

@roopakv
Copy link
Owner

roopakv commented Jun 7, 2020

hey @amerkay thank you for the note. Is there a specific command you'd like to use this for?

to potentially not break current users would you be ok if the -P flag is option to the command?

@amerkay
Copy link
Author

amerkay commented Jun 8, 2020

Hi, Thanks for the quick reply!

I'm trying to exclude a the /static folder from run_frontend_workflow, but process it using run_static_workflow only if the files in it change. It works if the -P is included to perform perl regex, which allows for negative lookahead.

code-param-name-map: '
    [
    {"regex": "^frontend(?!\/static).*", "param_name": "run_frontend_workflow"},
    {"regex": "^(frontend\/static).*", "param_name": "run_static_workflow"}
    ]'

So, yes, if you include it as an option, that'll solve my problem :)

@roopakv
Copy link
Owner

roopakv commented Jun 14, 2020

@amerkay you can use the perl search mode in v0.40.0 of swissknife for negative lookahead. It does require Perl to be installed but I think this is generally available on most Linux installs.

let me know if this doesn't work for you.

@amerkay
Copy link
Author

amerkay commented Jun 18, 2020

Hey! That's fantastic. Thank you. I'll give it a try next few days and report back if there are any issues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants