#!/usr/local/bin/perl -w use strict; my $p1 = qr(^.*?\s\-); my $p2 = qr(^.*?Special); my $p3 = qr(^.*?:); my $p4 = qr(^\'.*?\'); foreach (){ chomp; m[($p1)|($p2)|($p3)|($p4)]; #print "$_\n"; print "\t","$+\n"; } __DATA__ 'Inside: Single-Quotes' -XYZ the colon after inside 'Also in quotes' and Special Word and -Oops nothing more These are just plain words and dash -X and some data