#!/usr/bin/env perl use strict; use warnings; use Benchmark qw( cmpthese ); my @patterns = ( '(?:Internal\s+Revenue\s+Service|invaluable\s+practical|revenue\s+recognition|Treasury\s+Department|ETIF\s+accounting|implementation|administrative|authoritative|interpretive|superceding|regulatory|applicable|accounting|definitive|government|any\s+ruling|transition|procedural|receiving|technical|under\s+the|staff\'s|judicial|Treasury|valuable|specific|college|related|interim|valued|absent|their|his|SEC|FDA|IRS)\s+guidance', 'provided\s+by\s+(?:the\s+Securities\s+and\s+Exchange\s+Commission|Securities\s+and\s+Exchange\s+Commission|the\s+Financial\s+Accounting|Financial\s+Accounting|the\s+United\s+States|the\s+Secretary|United\s+States|Secretary|the\s+SEC|SEC)', 'issued\s+by\s+(?:the\s+Securities\s+and\s+Exchange\s+Commission|Securities\s+and\s+Exchange\s+Commission|the\s+Financial\s+Accounting|Financial\s+Accounting|the\s+United\s+States|the\s+Secretary|United\s+States|Secretary|the\s+SEC|SEC)', 'assumes\s+guidance\s+of\s+(?:the\s+talented\s+team|the\s+compensation|a\s+talented\s+team|a\s+compensation|the\s+company|the\s+board|a\s+company|a\s+board)', 'guidance\s+(?:promulgated\s+thereunder|promulgated|to\s+approve|technology|and\s+rules|facility|software|in\s+SFAS|system)', '(?:may\s+contain\s+statements\s+about\s+future\s+events,|if\s+on\s+negative|suggesting\s+an|Microsoft|rating)\s+outlook', 'according\s+to\s+the\s+guidance\s+contained', 'other\s+guidance\s+(?:issued|under|from)', 'provide\s+guidance\s+to\s+directors', 'current\s+guidance\s+(?:under|from)', 'applicable\s+guidance\s+issued', 'outlook\s+for\s+any\s+rating', ); my $alternations = '\b' . join( '\b|\b', @patterns ) . '\b'; $main::regex_opt = qr/$alternations/; $main::regex_old = qr/outlook\s+for\s+any\s+rating|(?:rating|if\s+on\s+negative|Microsoft|suggesting\s+an|may\s+contain\s+statements\s+about\s+future\s+events\,|business\s+conditions\s+and\s+the)\s+outlook|guidance\s+(?:to\s+approve|facility) |(?:authoritative|revenue\s+recognition|invaluable\s+practical|valuable|regulatory|technical|under\s+the|staff\'s|judicial|SEC|FDA|Treasury(?:\s+Department)?|specific|implementation|their|government|any\s+ruling|college|absent|\s+his|interim|interpretive|transition|administrative|procedural|related|applicable|accounting|definitive|superceding|IRS|Internal\s+Revenue\s+Service|valued|EITF\s+accounting)\s+guidance |guidance\s+(?:and\s+rules|promulgated(?:\s+thereunder)?|in\s+SFAS)|(?:provided|issued)\s+by\s+(?:the\s+)?(?:SEC|Securities\s+and\s+Exchange\s+Commission|Internal\s+Revenue\s+Service|Secretary|United\s+States|Financial\s+Accounting) |(?:other|applicable)\s+guidance\s+issued|according\s+to\s+the\s+guidance\s+contained|provide\s+guidance\s+to\s+directors|receiving\s+guidance |(?:current|other)\s+guidance\s+(?:under|from)|assumes\s+guidance\s+of\s+(?:the|a)\s+(?:company|board|talented\s+team|compensation)|guidance\s+(?:system|software|technology) /xi; $main::string = do { local $/ = undef; ; }; sub reopt { my $counter = () = $main::string =~ m/$main::regex_opt/g; return $counter; } sub reold { my $counter = () = $main::string =~ m/$main::regex_old/g; return $counter; } print reopt(), "\n"; print reold(), "\n"; cmpthese ( -10, { reopt => \&reopt, reold => \&reold, } ); __DATA__ outlook for any rating rating outlook if on negative outlook Microsoft outlook suggesting an outlook may contain statements about future events, outlook guidance to approve guidance facility authoritative guidance revenue recognition guidance invaluable practical guidance valuable guidance regulatory guidance technical guidance under the guidance staff's guidance judicial guidance SEC guidance FDA guidance Treasury guidance Treasury Department guidance specific guidance implementation guidance their guidance government guidance any ruling guidance college guidance absent guidance his guidance interim guidance interpretive guidance transition guidance administrative guidance procedural guidance related guidance applicable guidance accounting guidance definitive guidance superceding guidance IRS guidance Internal Revenue Service guidance valued guidance ETIF accounting guidance guidance and rules guidance promulgated guidance promulgated thereunder guidance in SFAS provided by the SEC provided by the Securities and Exchange Commission provided by the Secretary provided by the United States provided by the Financial Accounting provided by SEC provided by Securities and Exchange Commission provided by Secretary provided by United States provided by Financial Accounting issued by the SEC issued by the Securities and Exchange Commission issued by the Secretary issued by the United States issued by the Financial Accounting issued by SEC issued by Securities and Exchange Commission issued by Secretary issued by United States issued by Financial Accounting other guidance issued applicable guidance issued according to the guidance contained provide guidance to directors receiving guidance current guidance under other guidance under current guidance from other guidance from assumes guidance of the company assumes guidance of the board assumes guidance of the talented team assumes guidance of the compensation assumes guidance of a company assumes guidance of a board assumes guidance of a talented team assumes guidance of a compensation guidance system guidance software guidance technology #### 87 87 Rate reold reopt reold 1318/s -- -75% reopt 5189/s 294% -- #### 87 87 Rate reold reopt reold 2585/s -- -74% reopt 10114/s 291% --