[Linux-disciples] Perl: displaying the part of a match that failed
Chung-chieh Shan
ccshan at post.harvard.edu
Fri Jun 24 16:14:39 EDT 2005
On 2005-06-24T13:48:09-0400, Stephen R Laniel wrote:
> As I mentioned, I'm writing a hackish little CSS parser,
> using regular expressions to encode the grammar -- e.g.,
> something like
>
> my $block = qr/$openBrace\s*${statement}\s*$closeBrace/;
> my $statement = qr/${property}\s*:\s*$value;/;
> etc.
>
> If a stylesheet file doesn't match the regex, I'd like Perl
> to display for me the part of the file that failed to match.
> Is this possible?
I don't understand what "the part of the file that failed to match"
means. What part of "abcde" failed to match /^.*f.*$/ ?
--
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
OSCE report on 2004 USA elections: http://www.osce.org/item/13658.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050624/e3da5746/attachment.pgp
More information about the Linux-disciples
mailing list