#!/usr/bin/env perl use 5.010; use warnings; use strict; my $NUMBER = qr/(?i:three|four|five|six|seven|eight|nine|ten|\d+)/; my $PERIOD = qr/(?i:day|week|month|quarter|year)/; for ( map { chomp; $_ } ) { say "`$_' contains `$1'" if /\b ( (?:bi|semi)? [-]? (?:weekly|monthly) | (?:every\sother | twice\s)? (?:daily|monthly|quarterly|annually) | (?:once|twice|$NUMBER\stimes)\s (?:a|per)\s $PERIOD | (?:every\s(?:(?:other|twice)\s)?)? $PERIOD | (?:se|bi)?mestral ) \b /xi; } __DATA__ Here is the weekly TPS report. I go for a walk semimonthly. How often do you clean this toilet? Quarterly?! The sun comes up seven times per week. I get older every year. Not many people say "bimestral" anymore. #### `Here is the weekly TPS report.' contains `weekly' `I go for a walk semimonthly.' contains `semimonthly' `How often do you clean this toilet? Quarterly?!' contains `Quarterly' `The sun comes up seven times per week.' contains `seven times per week' `I get older every year.' contains `every year' `Not many people say "bimestral" anymore.' contains `bimestral'