Use String.toRegex() instead of Pattern.compile(s)
Proprietaryjava.util.regex.Pattern.compile(s) migrates to the Kotlin extension s.toRegex(), which returns a kotlin.text.Regex and reads more naturally.
org. openrewrite. kotlin. migrate. UseStringToRegex$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. migrate. UseStringToRegex$KtRecipe'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.