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

Allow replacers to uppercase/lowercase capturing groups #1363

Open
stinodego opened this issue Oct 10, 2023 · 1 comment
Open

Allow replacers to uppercase/lowercase capturing groups #1363

stinodego opened this issue Oct 10, 2023 · 1 comment

Comments

@stinodego
Copy link

stinodego commented Oct 10, 2023

My contributors do not always format their pull request titles appropriately, so I want to implement a replacer that always uppercases the first letter of the changelog entry. I tried this:

replacers:
  # Uppercase the first letter of each changelog entry
  - search: '/- ([a-z])/g'
    replace: '- \u$1'

The \u works for some regex replacers, like in VSCode. However, this does not seem to work. Is there a way I can achieve this? If not, consider this a feature request!

@jetersen
Copy link
Member

JavaScript sees the \u as an Unicode rather than a regex replacement.

I can't find any NPM package that implements this behavior so either we have written something or simply accept this is not something that is supported in JavaScript 😅

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

No branches or pull requests

2 participants