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

trim_end_match doesn't work as expected #1658

Closed
avi-cenna opened this issue Aug 10, 2023 · 1 comment
Closed

trim_end_match doesn't work as expected #1658

avi-cenna opened this issue Aug 10, 2023 · 1 comment

Comments

@avi-cenna
Copy link
Contributor

I'm not sure if I'm misunderstanding the documentation, but I would expect the following lines to print the same result.

test:
    echo {{ replace_regex('ping-pong', '-.*$', '') }}
    echo {{ trim_end_match('ping-pong', '-.*$') }}

In fact, the first line prints ping as expected, but the second line prints ping-pong. Isn't trim_end_match supposed to take a regular expression?

@avi-cenna avi-cenna changed the title time_end_match Doesn't work as expected trim_end_match Doesn't work as expected Aug 10, 2023
@avi-cenna avi-cenna changed the title trim_end_match Doesn't work as expected trim_end_match doesn't work as expected Aug 10, 2023
@casey
Copy link
Owner

casey commented Aug 11, 2023

Actually this is as-intended. Only _regex takes a regular expression, the other _match functions take a string literal which is matched verbatim.

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