Re: Get text between two substrings
Re: Get text between two substrings
- Subject: Re: Get text between two substrings
- From: Joseph Weaks <email@hidden>
- Date: Thu, 30 Jun 2005 03:27:44 -0500
On Jun 30, 2005, at 3:11 AM, Gary (Lists) wrote:
"Joseph Weaks" wrote:
Given a string, what is a good do shell script one-liner to grab the
text in between two sub-strings?
A non-optimized, format-dependent, not very robust PCRE
[Perl-compatible
reg-ex] (tested in TextWrangler) to grab an HTML comment could be:
Find: >([^<]*)!
Replace: \1
No no no no... sorry. I shouldn't have confused the issue by using tags
in the example. I want to pull the text that falls between to random
types of strings. Use this example:
set theString to "Foo I'm all that remains Bar"
set newString to do shell script "echo '" & theString & "' | perl
something 'Foo' something 'bar';print"
That clearer?
_______________________________________________
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