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

Allow regex parsing of files #70

Open
koseduhemak opened this issue Oct 27, 2020 · 1 comment
Open

Allow regex parsing of files #70

koseduhemak opened this issue Oct 27, 2020 · 1 comment

Comments

@koseduhemak
Copy link

Hi,

I got an idea for a new feature: Regex parsing which contents of a file should be extracted.
As files tend to change, it would be very helpful to enhance the parser to allow something like:
my-file.json#R:/"scripts".*\]/imgs
which should match the following contents of my-file.json:

... other content here...
"scripts": [
    "scripts/general-env-variables.sh",
    "scripts/ca-certificates.sh",
    "scripts/apt-install.sh",
    "scripts/timezone-fix.sh",
    "scripts/python-pip-repository.sh",
    "scripts/cloudfoundry-cli.sh",
]
... other content here...

See here for example: https://regex101.com/r/URfVWn/1

This way we can extract in a more flexible / reliable way and do not need to adjust start and end of line if source files are changing...

What do you think?

Best wishes,
koseduhemak

@zakhenry
Copy link
Owner

zakhenry commented Nov 4, 2020

So to clarify you're suggesting that an additional suffix be permitted that instead of defining which lines numbers to embed, it defines which lines matching an expression to embed?

I think this is a great idea, especially for data sources rather than code sources.

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

No branches or pull requests

2 participants