Class TextSearchEngine

java.lang.Object
ai.attackframework.tools.burp.utils.text.TextSearchEngine

public final class TextSearchEngine extends Object
Stateless search utility that returns all match ranges for either a regex query or a plain substring query. No Swing dependencies.

Design notes

  • Regex compilation/flags are delegated to Regex to keep flag logic centralized.
  • Substring matches are non-overlapping by design (typical “find next” behavior).
  • Returned ranges are half-open pairs [start, end] in document indexing space.
  • Method Details

    • findAll

      public static List<int[]> findAll(String haystack, TextQuery q)
      Find all match ranges for the given query.
      Parameters:
      haystack - text to search; null is treated as empty
      q - query descriptor (regex/substring, case, multiline)
      Returns:
      list of half-open ranges [start, end] (never null)
      Throws:
      NullPointerException - if q is null