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 returning double params #106

Open
miguelpeniche opened this issue Feb 2, 2020 · 4 comments
Open

Regex returning double params #106

miguelpeniche opened this issue Feb 2, 2020 · 4 comments
Assignees

Comments

@miguelpeniche
Copy link

So I'm trying to append text to some string and it appends double.

So this:

Captura de Pantalla 2020-02-02 a la(s) 12 22 50

Turns into this:

Captura de Pantalla 2020-02-02 a la(s) 12 24 20

@thierryc thierryc self-assigned this Feb 2, 2020
@thierryc thierryc added the bug label Feb 2, 2020
@thierryc
Copy link
Owner

thierryc commented Feb 2, 2020

Thank you for this report. I am working on it. I keep you posted.

@thierryc
Copy link
Owner

thierryc commented Feb 3, 2020

The result is "normal" the regex have the g modifier flag set. /gi by default to find all the occurrence.
g modifier: global. All matches (don't return after the first match).
This is the most common case.
In you case the result return 2 matches. (try it https://regex101.com)

This setting work.

image

@miguelpeniche
Copy link
Author

As texts don't end with a slash, It worked with:

Captura de Pantalla 2020-02-06 a la(s) 14 46 06

:D

But still, if I do the previous find & replace to a string with 3 slashes, it returns 2 results:

Captura de Pantalla 2020-02-06 a la(s) 14 47 30

Captura de Pantalla 2020-02-06 a la(s) 14 47 45

A little confused here

@thierryc
Copy link
Owner

thierryc commented Feb 6, 2020

Regex is confusing.
I am still investigating.
I would add an expert mode to access to the raw Regex like /(.*)//gi ...

@thierryc thierryc added enhancement and removed bug labels Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants