sm_expr_pattern($expr,$R,$ctx) ^

Generate code to match the string $expr against the regex $R.

generate_regex($R,$pass_label,$fail_label,$ctx) ^

Generate code for the given regex tree $R, using the regex context $ctx. $ctx contains a set of variable names:

  rx_input  - input string
  rx_starts - array of numbered capture starts
  rx_ends   - array of numbered capture ends
  rx_stack  - regex backtracking state stack
  rx_pos    - position within the input to begin matching
  rx_len    - length of input