You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/06/23 17:44:52 UTC
[I] use compiled regex [pekko-management]
pjfanning opened a new issue, #852:
URL: https://github.com/apache/pekko-management/issues/852
I don't think that any of the regex code in this module is on the hotpath but we could potentially change our String.replaceAll(regex, newValue) calls with:
```
import java.util.regex.Pattern
val UNDERSCORE_OR_DOT = Pattern.compile("[_.]");
val Pattern INVALID_CHARS = Pattern.compile("[^-a-z0-9]");
val str: String = ...
val withHyphens = UNDERSCORE_OR_DOT.matcher(lower).replaceAll("-")
val normalized = INVALID_CHARS.matcher(withHyphens).replaceAll("")
```
There are 5 or 6 different regexes that could be looked at.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [I] use compiled regex [pekko-management]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning closed issue #852: use compiled regex
URL: https://github.com/apache/pekko-management/issues/852
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org