Ok,
the best way (in my opinion), would be, assuming 's' and 'e' are the
start/end special characters:
$string =~ s/^.*?(s.*e).*$/$1/;
----- Original Message -----
From: "Nathaniel Mallet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 04, 2001 9:06 PM
Subject: Substring retrieval
Hi,
I'm trying to retrieve a substring from a string, but I'm not sure
exactly where and how big that substring is. The substring is delimited by a
start and end special character. It was suggested to me to write two regular
expression, one that would match everything up to and including the start
special character, and one to match everything following and including the
end special character, and replacing the matches with nothing.
I thought finding the location of the start and end special characters,
then calling substr().
And so I have to questions:
1 - How would I find the index for a particular character in a string?
2 - What's the best method, everything considered (simplicity, performance,
etc).
Thanks for your time.
Nat