Help for this page

Select Code to Download


  1. or download this
    m:  # use : as delims so / in code won't hurt
      ^ # Anchor it at start, don't need to backtrack
      (? # Start a conditional test
    ...
        |(?!) # Simplest "T|F" - match succeed, nonmatch fails
      ) # End the condition
    :x
    
  2. or download this
    #!/usr/bin/env perl
    use Benchmark 'cmpthese';
    ...
    pos_anch 1806441/s  168%      21%      15%       --      -5%     -67%
    pos_look 1906963/s  183%      27%      21%       6%       --     -65%
    3calls   5522908/s  719%     269%     252%     206%     190%       --