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

Case insensitivity? #127

Closed
jai opened this issue Feb 24, 2023 · 1 comment · Fixed by #132
Closed

Case insensitivity? #127

jai opened this issue Feb 24, 2023 · 1 comment · Fixed by #132

Comments

@jai
Copy link

jai commented Feb 24, 2023

Hi - first of all thanks for this action/code.

I'm using it to...well, find a comment :) and I was trying to make the search case-insensitive.

In the regex, I've tried:

\^.*no-experiment.*$\gi << silently fails (no error, but doesn't find "no-experiment" or "no-experimenT")

(?i)^.*no-experiment.*$ << throws an error

The error from the second regex is:

Error: Invalid regular expression: /(?i)^.*no-experiment.*$/: Invalid group

So it seems that the regex start/end /.../ are being added when the regex is parsed, so I'm unable to add anything outside the regex start/end (no flags i.e. case insensitive).

Do you know of a way I can achieve above? Or I can also submit a PR to make the search for body-includes case insensitive if it wasn't intended to be case sensitive (is it?)

@peter-evans
Copy link
Owner

Hi @jai

I've released an update to fix this issue. The action now supports regex flags in v2.3.0 / v2.

Your first example should now work:

\^.*no-experiment.*$\gi

Thank you for raising this issue and for your support! ☕ ❤️

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

Successfully merging a pull request may close this issue.

2 participants