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

Regex tester fails with optional group #1388

Open
gineer01 opened this issue Nov 12, 2024 · 2 comments · May be fixed by #1391
Open

Regex tester fails with optional group #1388

gineer01 opened this issue Nov 12, 2024 · 2 comments · May be fixed by #1391
Assignees
Labels
bug Something isn't working triage

Comments

@gineer01
Copy link

gineer01 commented Nov 12, 2024

Describe the bug

Testing \s([^\s\[]+)(?:\[(\d+)\])?:\s against this input:

Nov 11 21:03:26 abc2 def.sh[1]: 
Nov 11 21:03:26 abc2 def.sh: 

It shows no match.

image

What happened?

It seems the regex tester fails with the second line for some reason:

  • Without the second line, it can match the first line Nov 11 21:03:26 abc2 def.sh[1]: , which is correct.
  • With the second line, it shows no match at all (even no match for the first line).

Expected output (try https://regex101.com/ for example): 2 matches (the [1] part is optional in the regex)

image

System information

Firefox

Where did you encounter the bug?

A self hosted

@gineer01 gineer01 added bug Something isn't working triage labels Nov 12, 2024
sharevb added a commit to sharevb/it-tools that referenced this issue Nov 17, 2024
@sharevb sharevb linked a pull request Nov 17, 2024 that will close this issue
@sharevb
Copy link
Contributor

sharevb commented Nov 17, 2024

Hi @gineer01 and @CorentinTh, fixed in #1391, thanks for your bug report

@sharevb
Copy link
Contributor

sharevb commented Nov 24, 2024

Hi, for people interested in up to date version of it-tools, I made kind of a fork here : https://github.com/sharevb/it-tools (https://sharevb-it-tools.vercel.app/ and docker images https://github.com/sharevb/it-tools/pkgs/container/it-tools)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants