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

Enhanced replacement options for generic regexes #5960

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GregOriol
Copy link
Contributor

As a followup for #5959, I've tried an idea and would like to suggest this change to have enhanced replacement options for generic regexes.

The idea is that in addition to $1 $2 $3 remplacements, we could also have modifiers like $u1 $l2 $uf3 to replace by an uppercase lowercase or uppercase-first value.

This would allow to keep the current generic non-case-sensitive regexes, while also supporting some user-agents where parts are in a wrong/outrageous case, like the example in the fixture with "Moto G" being provided as "g" in the user-agent.

This is backwards compatible and doesn't slow down the detection.

@sgiehl
Copy link
Member

sgiehl commented May 13, 2019

nice improvement. Guess we could merge for the next major release. Can't merge that right away, as it might break some of the ports to other languages reusing the yml files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants