title: Remove possible sequences from a string using regular expressions?
body: <p>I have a list of strings, some (not all) that have endings like:</p>
  
  <pre><code>"StringSignOut"
  "String Sign Out"
  "String SIGNOUT"
  "StringSO"
  "String SO"
  "String S.O."
  "StringS.O."
  </code></pre>
  
  <p>I want to get rid of all the sign outs and SOs, I'm just not sure how to do the pattern.</p>
  
  <pre><code>    private static String getGroup(String s, String pat, int g) {
          Pattern p = Pattern.compile(pat);
          Matcher m = p.matcher(s);
          if (m.matches()) {
              return m.toMatchResult().group(g);
          } else {
              return null;
          }
      }
  </code></pre>