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"