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

Regex don't allow matching non-word chars #249

Open
JuliusNmn opened this issue Dec 13, 2023 · 1 comment
Open

Regex don't allow matching non-word chars #249

JuliusNmn opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@JuliusNmn
Copy link

JuliusNmn commented Dec 13, 2023

i want to anonymize javadoc @author with a regex, but my regex @author .* fails to replace them. example:

/** a b c
* @author julius
*/

as i can see in source code, all terms are wrapped in \b tags, which fail to capture the @ character.
my workaround was to use author \w.* instead, which works well enough, but might match in places where it shouldn't.

proposed fix: don't wrap a regex in \b if it begins/ends in non-word characters?

@tdurieux
Copy link
Owner

I a aware of this, but the benefits are bigger than the drawbacks. For now, it will stay like this until I find a better solution.

@tdurieux tdurieux added the bug label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants