Skip to content

Feature Request: Pattern functions #25

@wdkrnls

Description

@wdkrnls

Great package! This saves me from having to leave R for many tasks. I'm curious if you think it would be reasonable to support pattern functions similar to those provided by the TXR pattern munging language https://www.nongnu.org/txr/? This would be in addition to regular expressions. For example, I might want to ensure a patterns could be matched against a vector of options.

Imagine I have the data:

The green lawn.
The red chair.
The blue box.
The grey cat.

I define the pattern function:

known_color = function(x) x %in% c("green", "red", "blue", "grey")

Then I can extract like:

unglue_data("The {color=known_color} {object}.")

Thanks for your consideration and great work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions