### Question:
RegExHelper { public static boolean stringMatchesPattern (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue) { return getMatcher (sRegEx, sValue).matches (); } 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 @SuppressFBWarnings (value = "NP_NONNULL_PARAM_VIOLATION") public void testStringMatchesPattern () { assertTrue (RegExHelper.stringMatchesPattern ("[0-9]+", "1234")); assertTrue (RegExHelper.stringMatchesPattern ("[0-9]+", "0")); assertFalse (RegExHelper.stringMatchesPattern ("[0-9]+", "")); assertTrue (RegExHelper.stringMatchesPattern ("[0-9]*", "")); assertTrue (RegExHelper.stringMatchesPattern ("abc", "abc")); assertTrue (RegExHelper.stringMatchesPattern ("abc+", "abcccccccccccc")); assertFalse (RegExHelper.stringMatchesPattern (".*[0-9]+.*", "abc\nx1234y\nzzz")); assertTrue (RegExHelper.stringMatchesPattern ("(?s).*[0-9]+.*", "abc\nx1234y\nzzz")); assertTrue (RegExHelper.stringMatchesPattern (".*[0-9]+.*", Pattern.DOTALL, "abc\nx1234y\nzzz")); try { RegExHelper.stringMatchesPattern (null, "any"); fail (); } catch (final NullPointerException ex) {} try { RegExHelper.stringMatchesPattern ("", "any"); fail (); } catch (final IllegalArgumentException ex) {} try { RegExHelper.stringMatchesPattern ("[0-9]+", null); fail (); } catch (final NullPointerException ex) {} }