-
Notifications
You must be signed in to change notification settings - Fork 109
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
warning: nested repeat operator '+' and '?' was replaced with '*' in regular expression #91
Comments
I am also getting this on Prod |
+1 |
1 similar comment
+1 |
Glad it's not just me! Thanks for checking it out 👍 |
+1 |
Looks like there's a fix for this at #90 , but maintainers do not want to merge it, because the regexp comes from upstream. Maintainers, an update on this issue would be helpful! I only started getting these warnings in my logs updating from device_detector 1.0.5 to 1.0.6. Which I don't really understand, because I don't think the relevant line flagged in the warning does seems to have changed in 1.0.6, if I'm reading git blame right, it hasn't changed in 6 years?
I really want to get these warnings out of my logs, they are making my build logs much harder to read, they appear many times.... anyone have any ideas for ways to suppress these lines from build logs, if maintainers of device_detector can't solve the problem? |
OK, I can't quite figure out why this warning only started appearing with device_detector 1.0.6, exactly what is triggering it, the code is a bit complicated. We are all assuming the warnings are spurious, the regexes are actually functioning as desired, just triggering a warning that can be ignored? I haven't verified that myself, but on that assumption... Here's a way to suppress the warnings in your logs, using the ruby-warning gem. Add that gem to your project, then in some initialization file for your project/tests: # avoid ruby warnings in our logs related to a regular expressions in the device_detector
# gem, a known problem that is unlikely to be fixed upstream.
# https://github.com/podigee/device_detector/issues/91
if device_detector_source_path = Gem.loaded_specs['device_detector']&.full_gem_path
parser_source_file_path = (Pathname.new(device_detector_source_path) + "lib/device_detector/parser.rb").to_s
Warning.ignore(/regular expression/, parser_source_file_path)
end |
… are unlikely to ever be fixed upstream podigee/device_detector#91
I am also getting this error on 1.0.6 |
Same here; I recently updated from 1.0.5 to 1.0.6 and I immediately started getting the same errors as yakschuss. |
Looks like it's been fixed upstream matomo-org/device-detector#6992. Have someone the energy to open a PR with updated YAML files in this project and bump the version ? |
Thanks everybody for keeping track and all your efforts. We will provide a newer version of the gem soon. |
Hi! This gem is currently being used as a dependency, and I noticed a gem specific warning that pops up when
device_detector
is initialized.Specifically:
warning: nested repeat operator '+' and '?' was replaced with '*' in regular expression
ANDregular expression has ']' without escape
It looks like the issue is stemming from this file on line 88.
I don't know a ton about Regexp and would probably have a difficult time trying to solve this.
Thanks!
The text was updated successfully, but these errors were encountered: