Thanks for your answers. They were helpful.
Terry
>>> "Terry Vaughn" <[EMAIL PROTECTED]> 11/12/02 03:20PM >>>
THis is the best I could come up with so far.would prefer to use something with
reg expressions :
$linetoprobe = "YYY~ZZZ";
@mytempvalue = split(/ZZZ/, $linetoprobe);
print sub
THis is the best I could come up with so far.would prefer to use something with
reg expressions :
$linetoprobe = "YYY~ZZZ";
@mytempvalue = split(/ZZZ/, $linetoprobe);
print substr(@mytempvalue[0], -1);
>>> "Terry Vaughn" <[EMAIL PROTECTED]> 11/12/02 03:11PM >>>
Hello all.
$linetoprobe
my ($mytempvar) = $linetoprobe =~ /(^.*)ZZZ/;
--
James Schappet
http://www.schappet.com
On Tue, 12 Nov 2002, Terry Vaughn wrote:
> Hello all.
>
> $linetoprobe = "YYY~ZZZ" ;
>
> How Do I assign $mytempvar the character immediately prior to "ZZZ" using reg exp??
Terry,
Try this:
($mytempvar) = $linetoprobe =~ m/(.)...$/;
Putting $mytempvar in the () assigns it the character in the () in the
regular expression match where a "." will match any character.
Matt Schneider
Programmer/System Administrator
SKLD Information Services, LLC
($mytempvar) =
--