[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ast-developers
Subject:    [ast-developers] ksh93 regular expressions and perl
From:       dgk () research ! att ! com (David Korn)
Date:       2005-07-21 18:33:53
Message-ID: 200507212233.SAA64902 () raptor ! research ! att ! com
[Download RAW message or body]

cc:  ast-developers@research.att.com
Subject: Re: Re: [ast-developers] ksh93 regular expressions and perl
--------

> On Mon, 2005-07-04 at 23:20 -0400, David Korn wrote:
> > Also, you can use ${.sh.match[i]} to get the i'th subexpression match
> > after a pattern match.
> 
> According to the ksh93 man page (and some experiments), this only works
> after variable expansions using # % and /.  Therefore, it does not work
> after simple pattern matches in if statements.
> 
> I can see using it after if-expression matching but not really ever
> using it after variable expansion.  Please let me know how much effort
> you think it takes to add the behavior.  I currently run
> 
> ksh93 Version M 1993-12-28 q
> 
> Thanks.
> /Joe
> 
> 
> 

I am planning to have .sh.match available if there are any subpatterns
in the pattern and the complete pattern matches.  Thus,
	[[ foobarbam == foo@(*)bam ]] && print ${.sh.match[1]}
will output bar.  I expect that this will be in ksh93q which is
currently in beta.

David Korn
dgk@research.att.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic