Now When I run this:#!/usr/local/bin/perl -w use strict; my $p1 = qr(^.*?\s\-); my $p2 = qr(^.*?Special); my $p3 = qr(^.*?:); my $p4 = qr(^\'.*?\'); foreach (<DATA>){ 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
'Inside: Single-Quotes' -
'Also in quotes' and Special Word and -
These are just plain Special words and dash -
I would like to have
Inside Also in quotes These are just plainThanks
In reply to Another First Pattern Matching by artist
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |