### Question:
RegExHelper { @Nonnull public static String stringReplacePattern (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue, @Nullable final String sReplacement) { return getMatcher (sRegEx, sValue).replaceAll (StringHelper.getNotNull (sReplacement)); } private  RegExHelper(); @Nonnull static String [] getSplitToArray(@Nullable final CharSequence sText, @Nonnull @RegEx final String sRegEx); @Nonnull static String [] getSplitToArray(@Nullable final CharSequence sText,
                                           @Nonnull @RegEx final String sRegEx,
                                           @Nonnegative final int nLimit); @Nonnull static ICommonsList <String> getSplitToList(@Nullable final CharSequence sText, @Nonnull @RegEx final String sRegEx); @Nonnull static ICommonsList <String> getSplitToList(@Nullable final CharSequence sText,
                                                      @Nonnull @RegEx final String sRegEx,
                                                      @Nonnegative final int nLimit); @Nonnull static Matcher getMatcher(@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue); @Nonnull static Matcher getMatcher(@Nonnull @RegEx final String sRegEx, @Nonnegative final int nOptions, @Nonnull final String sValue); static boolean stringMatchesPattern(@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue); static boolean stringMatchesPattern(@Nonnull @RegEx final String sRegEx,
                                              @Nonnegative final int nOptions,
                                              @Nonnull final String sValue); @Nonnull static String stringReplacePattern(@Nonnull @RegEx final String sRegEx,
                                             @Nonnull final String sValue,
                                             @Nullable final String sReplacement); @Nonnull static String stringReplacePattern(@Nonnull @RegEx final String sRegEx,
                                             @Nonnegative final int nOptions,
                                             @Nonnull final String sValue,
                                             @Nullable final String sReplacement); @Nullable static String getAsIdentifier(@Nullable final String s); @Nullable static String getAsIdentifier(@Nullable final String s, final char cReplacement); @Nullable static String getAsIdentifier(@Nullable final String s, @Nonnull final String sReplacement); static boolean isValidPattern(@Nonnull @RegEx final String sRegEx); @Nullable static String [] getAllMatchingGroupValues(@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue);  }### Answer:
@Test public void testStringReplacePattern () { assertEquals ("xy", RegExHelper.stringReplacePattern ("\\$email", "$emaily", "x")); }