@Override
        public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) {
          // verify that only supported attributes of the standard include directive are used
          verifyUsedAttributes(reader, attributes);

          // read the includee text if possible
          Path includee = Path.of(reader.getFile()).getParent().resolve(target);
          String includeeText = readText(includee);

          // algorithm for lines and tags filtering is adapted from original Asciidoctor implementation at
          // https://github.com/asciidoctor/asciidoctor/blob/4dec7ad055b30a5fe983d44019f9e5531a88d43a/lib/asciidoctor/reader.rb#L1057
          // hopefully once https://github.com/asciidoctor/asciidoctor/issues/571 is resolved we can reuse the built-in logic here
          if (attributes.containsKey("lines")) {
            filterForLines(document, reader, target, includee, includeeText, attributes);
          } else if (attributes.containsKey("tag") || attributes.containsKey("tags")) {
            filterForTags(document, reader, target, includee, includeeText, attributes);
          } else if (!includeeText.isEmpty()) {
            // include full includee
            pushMarkedInclude(document, reader, target, new StringBuilder(includeeText), 1, includee, attributes);
          }
        }
The pattern for matching a tagged line in the included file.
This is adapted from the original Ruby regex in Asciidoctor.

@see <a href ="https://github.com/asciidoctor/asciidoctor/blob/4dec7ad055b30a5fe983d44019f9e5531a88d43a/lib/asciidoctor/rx.rb#L108">lib/asciidoctor/rx.rb</a>
build-logic/asciidoc-extensions/src/main/java/org/spockframework/plugins/asciidoctor/IncludedSourceLinker.java