Re: [MacPerl] Regex riddle

2003-03-17 Thread Bart Lateur
On Mon, 17 Mar 2003 00:52:21 +0100 (MET), Louis Pouzin wrote: >The intent is to catch all text from a line and its continuation if any (in msg >headers). Here's another approach that does basically that same thing: @headers = split /\n(?![\ \t])/, $headers; It splits on newlines (while

Re: [MacPerl] Regex riddle

2003-03-16 Thread Ronald J Kimball
On Mon, Mar 17, 2003 at 12:52:21AM +0100, Louis Pouzin wrote: > Hi, > > Here is a regex I can't figure out. The intent is to catch all text from > a line and its continuation if any (in msg headers). In the case here, it > doesn't work. Anyone could explain ? Thanks. Your regex uses \s* where it

[MacPerl] Regex riddle

2003-03-16 Thread Louis Pouzin
Hi, Here is a regex I can't figure out. The intent is to catch all text from a line and its continuation if any (in msg headers). In the case here, it doesn't work. Anyone could explain ? Thanks. #!/usr/local/bin/perl -w use strict; my $lgl = '\s*((?:.*?)\n(?:\s+.*?\n)*)'; my $a = "Head:\nSubje