anonymous_github
anonymous_github copied to clipboard
Regex don't allow matching non-word chars
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?
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.