Closed Palloxin closed 2 months ago
I have copied the regex you wrote in this issue in regex101 with Java 8 and no match is found
Could you try it again and send me the regular expression and text to reproduce it?
Thank you a lot.
I just copied the regex and string from this issue, it works fine. Maybe try again idk. Tried on Firefox and Chrome (Windows 10)
The regex peculiarity is that it doesnt match characters but a specific position:
I was able to reproduce the issue and found the differences using regex101. In my case, I am discarding all empty strings, while regex101 matches an empty string. Does this really make sense?
Could you explain what the purpose of this regular expression is? I'm analyzing it and can't find any relevant information on matching empty strings. In fact, if I make the changes in my app, you might see one match, but nothing is displayed in the text because it is an empty string.
A regex to match a position(empty string) to put the replacement in a specific place.
Using looking behind and/or look ahead one can achieve it easily.
Example:
string: Bobu went to eat
regex_1: /(?=Bobu\b)/
replacement_1: DD
Final string: DD Bobu went to eat
string: Bobu went to eat
regex_1: /(?<=Bobu\b)/
replacement_1: finally
Final string: Bobu finally went to eat
More concrete example: Thousands separator(comma)
.replace(/\B(?=(\d\d\d)+(?!\d))/g, ',')
There are also performance reasons. Making mindlessly groups in a regex is not a good idea, performance wise. I just use lookbehind as reference without matching.
Okey, I'll have in account and fix as soon as possible
I recall the app matched this kind of regexes in previous versions. It was just missing the purple like in the image above.
This will be fixed in version 5.8.2. It may take some time to be deployed as it is currently under review by Google.
Regex101:
App:
regex:
string:
height of one hundred feet
I have no idea why it doesnt match, no errors whatsoever showed.
Every flavour in regex101 gives either "error pattern" or a "match". The app doesnt show any error. Edit: somehow the app doesnt match empty space(position) anymore.