Re: Native AS or grep via do shell script?
Re: Native AS or grep via do shell script?
- Subject: Re: Native AS or grep via do shell script?
- From: Christopher Nebel <email@hidden>
- Date: Fri, 29 Oct 2004 15:39:42 -0700
On Oct 29, 2004, at 3:43 AM, Jakob Peterhänsel wrote:
That perl stuff seems to work, but I can't get it to return stuff where the matching is over multiple lines.
Consider the text:
------Email Body--------------
Entry text line here:
Area Discription
In periode from
dd-mm-yyyy hh:mm
to
dd-mm-yyyy hh:mm
Bla.. bla...
-------Email body end---------
Now this code works fine:
set "perl -ne 'print if s/(Are\\w+)/$1/;'"
set do shell script "echo " & quoted form & " | " & cliCmd
--> Area Discription
If I introduce some newline matching, it fails, like:
set "perl -ne 'print if s/\\r(\\w+)/$1/;'"
I'm really puzzled over this, as the perlre man-page say's it should be working. Even using \n gives the same no-match.
Naturally. -n implicitly handles your input one line at a time. Go read perlrun(1). If you want multi-line matches, you'll have to drop the -n and gather all the input first, perhaps like this:
$_ = join "", <>;
Trying to use Perl without understanding what you're doing is generally considered a bad idea.
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden