re_match RE_0, "afoobarz"
RE_0:
# /fo*?bar/s (and yes, the "s" flag is pointless)
re_flags "s"
re_minlength 4
$start: #a 'local' label--it disappears the next time a normal
# label is seen
re_pushindex #in case we fail in $find_o or something
re_literal "f", $find_bar
re_popindex
re_advance $failure
branch $start #think "goto"
$find_o:
re_literal "o", $find_bar
branch $start
$find_bar:
re_literal "bar", $success
branch $find_o
$success:
set I0, 1
branch $end
$failure:
set I0, 0
$end:
re_finished
####
$start:
re_pushindex
re_literal "f", $advance
$find_bar:
re_literal "bar", $find_o
#if we made it this far, we're done!
set I0, 1
branch $end
$find_o:
re_literal "o", $advance
branch $find_bar
$advance:
re_popindex
re_advance $failure
branch $start
$failure:
set I0, 0
$end:
re_finished
####
RE_1:
#/[az][by][cx]/
re_flags ""
re_minlength 3
$start:
re_pushindex
re_oneof "az", $advance
re_oneof "by", $advance
re_oneof "cx", $advance
set I0, 1
branch $end
$advance:
re_popindex
re_advance $fail
branch $start
$fail:
set I0, 0
$end:
re_finished