@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
  @Contract(pure = true)
  @Deprecated
  default @NotNull Component replaceFirstText(final @NotNull Pattern pattern, final @NotNull Function<TextComponent.Builder, @Nullable ComponentLike> replacement) {
    return this.replaceText(b -> b.match(pattern).once().replacement(replacement));
  }
Finds and replaces the first occurrence of text within any {@link TextComponent}s using a regex pattern.

@param pattern a regex pattern
@param replacement a function to replace the first match
@return a modified copy of this component
@since 4.0.0
@deprecated for removal since 4.2.0, use {@link #replaceText(Consumer)} or {@link #replaceText(TextReplacementConfig)} instead.
api/src/main/java/net/kyori/adventure/text/Component.java