Skip to content

💡 Support named capture groups in RegEx #423

@MarcusOtter

Description

@MarcusOtter

Describe the improvement

We should support named capture groups in RegEx, and then let the user tell us which groups they want to include in the title and where, with custom variables. If these are used, they should ignore the RegEx matches completely in the title output.

Problems this improvement solves

Right now, with the text:

Never Alone (Kisima Ingitchuna) ~~R$14.99~~ **Grátis** até 27/04/2023 • Epic Games Abra no navegador https://store.epicgames.com/p/never-alone-kisima-ingitchuna Abra no Launcher da Epic Games com.epicgames.launcher://store/p/never-alone-kisima-ingitchuna

It would be hard to make the title

Free on Epic Games: Never Alone (Kisima Ingitchuna)

Because it includes two parts of the input that are in reverse order. If we could use named RegEx groups it would be an easy query, something like this:

/(?<title>.*?) ~~.*(?<platform>steam|epic games)/i

Which could make the title something like this... (not sure about how we design the API yet)

Free on $platform: $title /(?<title>.*?)~~.*(?<platform>steam|epic games)/i

Alternative solutions

The alternative is writing really complex RegExes that makes sure to not match any text and only save in capture groups. Even then, this is super hard because it's in reverse order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions