Re: How to use "do shell script" to search for RegExps
Re: How to use "do shell script" to search for RegExps
- Subject: Re: How to use "do shell script" to search for RegExps
- From: Nigel Smith <email@hidden>
- Date: Thu, 22 Apr 2004 16:43:59 +0100
On 22/4/04 9:13, "Emmanuel" <email@hidden> wrote:
>
At 4:56 PM -0400 21/04/04, Rebecca O'Connell wrote:
>
> if myVar contains \(a|A)\ then set hasA to true
>
>
>
> using a shell script how would I go about it?
>
>
Not a reply to your question, but why not using AppleScript? It's more
>
user-friendly, and the parameter passing mechanism is far more sophisticated
>
and powerful than for shell scripts, isnt'it.
>
>
Using the Satimage osax:
>
>
--------------------------
>
set hasA to false
>
try
>
find text "a" in myVar without case sensitive
>
set hasA to true
>
end try
>
--------------------------
If Rebecca's example is really representative of what she wants, and not
just a much-simplified example, then wouldn't:
return myVar contains "a"
...be even simpler :-)
IIRC, the default case sensitivity changed at some point (AS v1.8?).
Shouldn't matter to Rebecca if she is considering shell scripts and
therefore has OSX, but the above would be even more portable as:
ignoring case
return myVar contains "a"
end ignoring
Later,
Nigel
_______________________________________________
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.