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.

@sgiehl sgiehl changed the base branch from master to v4 August 11, 2019 13:19
@sgiehl sgiehl force-pushed the v4 branch 2 times, most recently from 71f7ba4 to 147f7a9 Compare August 19, 2019 19:34
@sgiehl sgiehl force-pushed the v4 branch 4 times, most recently from b965528 to 44e7ae3 Compare September 2, 2019 09:16
@sgiehl sgiehl force-pushed the v4 branch 3 times, most recently from 65c9c99 to 0f08fdd Compare September 27, 2019 14:46
@sgiehl sgiehl force-pushed the v4 branch 2 times, most recently from 7788806 to 6093675 Compare October 28, 2019 12:57
@sgiehl sgiehl force-pushed the v4 branch 6 times, most recently from 4c9f4ff to c8c9add Compare January 13, 2020 16:00
@sgiehl sgiehl changed the base branch from v4 to master November 19, 2020 13:32
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