• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Regex on OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regex on OS X


  • Subject: Re: Regex on OS X
  • From: John Delacour <email@hidden>
  • Date: Tue, 1 Oct 2002 23:24:47 +0100

At 2:38 pm -0700 1/10/02, bill fancher wrote:

Or you could avoid the bone-ugliness of perl (exacerbated by the need to escape "\") and replace the last five lines with:

set JAN_HITS to do shell script "echo " & s & "|grep Jan"

Well apart from the fact that perl's beauty is without compare, you obviously didn't bother to run my script to find out what it did and I'm afraid you're going to have to disembellish and deminimize your script somewhat in order to get it to do the same.

I deliberately made the perl look ugly in order to tease out a minimalist :-). Perl's grep is just as short and pretty.


This echo's the string, pipes the result to grep, and grep searches it for Jan.

Yep.

Perhaps the most compelling advantage of either approach here is that users aren't required to install a third party osax to use the script.

Added to which they don't need to learn a dozen different half-baked and contorted regex syntaxes.

(If grep doesn't do it for you, there's also sed, awk, egrep,...)

Not to speak of oux, fank, hhj, clak and fother.

JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Regex on OS X
      • From: bill fancher <email@hidden>
References: 
 >Re: Regex on OS X (From: bill fancher <email@hidden>)

  • Prev by Date: Re: Entourage or Mail.app?
  • Next by Date: Re: Scripting THROUGH terminal?
  • Previous by thread: Re: Regex on OS X
  • Next by thread: Re: Regex on OS X
  • Index(es):
    • Date
    • Thread