Skip to content

replace seems to be greedy even with few #44

@jtojnar

Description

@jtojnar
> replace ("x" <$ string "/*" <* few anySym <* string "*/") "1 /* foo */ 2 /* bar */ 3"
"1 x 3"

Whereas I would expect 1 x 2 x 3 as a result.

Replacing findLongestInfix by findFirstInfix in replace definition seems to fix this case but I am not sure if this is a proper solution.

Using regex-applicative-0.3.4

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