Skip to content

Add consumer converter for regular expressions #167

@pineapplemachine

Description

@pineapplemachine

In short, this should work:

hi("some string").split(/\s+/)

Anywhere that accepts a consumer should also accept and automatically convert a regular expression object.

As of writing there are converters for predicates and sequence inputs, but none for regex objects. It should be possible (if a bit tricky) to write a consumer type whose behavior is determined by a regular expression

Supporting regex lookaround should not be part of this issue. After this issue is resolved, then whether or not to support this feature should be re-evaluated. At present, it looks as though adding support for lookaround would require a substantial increase in complexity for consumers and any code that uses them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: very highThe issue will probably take a single contributor more than a week of work to resolve.priority: mediumThe issue makes it more difficult for people to use the software.type: featureThe issue involves adding new or extended behavior to the software.type: polishThe issue involves making existing functionality more usable.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions