private Integer extractInteger(String numberString) {
          Matcher numberMatcher = EXTRACT_NUMBER_PATTERN.matcher(numberString);
          if (numberMatcher.matches()) {
            return Integer.valueOf(numberMatcher.group());
          }
          return null;
        }
Extracts an integer from a {@code String} like Ruby does it.

@param numberString The string to extract the integer from
@return {@code null} if the string does not start with an integer, otherwise the parsed integer
build-logic/asciidoc-extensions/src/main/java/org/spockframework/plugins/asciidoctor/IncludedSourceLinker.java