code: def test_sql_regex_expr_match(
      regex_op: str, expected: list[int]
  ) -> None:
      # note: the REGEXP and RLIKE operators can also use another
      # column/expression as the source of the match pattern
      df = pl.DataFrame(
          {
              "idx": [0, 1, 2, 3, 4],
              "str": ["ABC", "abc", "000", "A0C", "a0c"],
              "pat": ["^A", "^A", "^A", r"[AB]\d.*$", ".*xxx$"],
          }
      )
      with pl.SQLContext(df=df, eager_execution=True) as ctx:
          out = ctx.execute(
              f"SELECT idx, str FROM df WHERE str {regex_op} pat"
          )
          assert out.to_series().to_list() == expected
  
imports: from __future__ import annotations
  import datetime
  import math
  from pathlib import Path
  import pytest
  import polars
  import polars.selectors
  from polars.exceptions import ComputeError, InvalidOperationError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 20 for calling a global function with example usage: test_sql_regex_expr_match(regex_op, expected) without return types