code: public static final ScopeInfo extractScopeFirst(final String str, final String beginMark, final String endMark) {
          final List<ScopeInfo> scopeList = doExtractScopeList(str, beginMark, endMark, true);
          if (scopeList == null || scopeList.isEmpty()) {
              return null;
          }
          if (scopeList.size() > 1) {
              String msg = "This method should extract only one scope: " + scopeList;
              throw new IllegalStateException(msg);
          }
          return scopeList.get(0);
      }
docs: ==============