public static String cleanStackingMarkers(String filename){
  if (!StringUtils.isEmpty(filename)) {
    Matcher m=stackingPattern1.matcher(filename);
    if (m.matches()) {
      return m.group(1) + m.group(3);
    }
    m=stackingPattern2.matcher(filename);
    if (m.matches()) {
      return m.group(1) + m.group(3);
    }
    m=stackingPattern3.matcher(filename);
    if (m.matches()) {
      return m.group(1) + m.group(3);
    }
    m=stackingPattern4.matcher(filename);
    if (m.matches()) {
      return m.group(1) + m.group(3);
    }
  }
  return filename;
}

public static String cleanStackingMarkers ( String filename ) { if ( ! StringUtils . isEmpty ( filename ) ) { Matcher m = stackingPattern1 . matcher ( filename ) ; if ( m . matches ( ) ) { return m . group ( 1 ) + m . group ( 3 ) ; } m = stackingPattern2 . matcher ( filename ) ; if ( m . matches ( ) ) { return m . group ( 1 ) + m . group ( 3 ) ; } m = stackingPattern3 . matcher ( filename ) ; if ( m . matches ( ) ) { return m . group ( 1 ) + m . group ( 3 ) ; } m = stackingPattern4 . matcher ( filename ) ; if ( m . matches ( ) ) { return m . group ( 1 ) + m . group ( 3 ) ; } } return filename ; }
clean stacking markers . < br > same logic as detection , but just returning string w / o
