Courts need to pull the case-year token from mixed caption strings using a regular expression. Which function should extract that substring?
Select an answer to reveal the explanation.
Short Explanation
REGEXP_SUBSTR is the highlight-and-copy tool—it pulls the case-year chunk out of a messy caption. REGEXP_LIKE only says yes or no; it does not hand you the token.
Full Explanation
Courts that must pull the case-year token from mixed caption strings need extraction, not merely a Boolean match. REGEXP_SUBSTR (or equivalent substring regex function) applies the pattern and returns the matched case-year characters so downstream logic can filter, partition, or validate filings by year without brittle fixed-position substring calls.
REGEXP_LIKE returns whether the caption matches; it does not hand back the case-year token. JSON_VALUE navigates JSON paths and fails or misleads when the caption is plain text, not JSON. A UNIQUE constraint enforces uniqueness on insert; it does not isolate or extract case-year tokens from caption strings.
Exam caveat: capture groups and occurrence arguments matter when captions contain multiple year-like tokens; pin the pattern to the court’s caption format. Operational check: run REGEXP_SUBSTR on a representative caption set with known years, compare extracted tokens to the clerk’s expected year, and add negative cases (no year, multiple years) to document behavior. Persist the extracted case year into a typed column when it drives partitioning, retention, or security filters so online queries do not re-evaluate regex on every caption scan. Re-run extraction in a controlled batch when caption formats change rather than silently accepting NULL years into year-based reports.