> -----Original Message-----
> From: Gibbs Tanton - tgibbs [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 05, 2001 4:25 AM
> To: 'Florentin Ionescu '; '[EMAIL PROTECTED] '
> Subject: RE: regex
>
>
> I believe you want $2, not $1. Either that or use ?: in the
> first set of
> parentheses.
>
> -----Original Message-----
> From: Florentin Ionescu
> To: [EMAIL PROTECTED]
> Sent: 10/4/2001 8:48 PM
> Subject: regex
>
> I am trying to extract "xvar" from a string like
> $a="la la la set /Y xvar= yval".- the switch /y can exist or not.
>
> $a=~s#.*[Ss][Ee][Tt]\s+(\/\w?)\s+(\w+)=.*#$1#;
^in this case only the Y is optional not the '/'
^ $1 ^ $2
$a=~s#.*[Ss][Ee][Tt]\s+(\/\w\s+)?(\w+)=.*#$2#; OR
$a=~s#.*[Ss][Ee][Tt]\s+(?:\/\w\s+)?(\w+)=.*#$1;
^not in the list
>
> Why doesn't this get "xvar" from $a ?
>
>
> Thank you for participation,
> Florentin.
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]