Re: Bash, sed: extracting regex subexpressions

2008-05-28 Thread John O'Hagan
> On Tue, May 27, 2008 at 4:49 PM, John O'Hagan <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I've been looking for a command I can use in bash scripts that will do > > something like this: > > > > $COMMAND(n[,m...]) (REGEX-1)(REGEX-2)[...] <($FILE) > > > >(MATCH-n)[(MATCH-m)...] > Thanks fo

Re: Bash, sed: extracting regex subexpressions

2008-05-27 Thread Todd A. Jacobs
On Tue, May 27, 2008 at 02:49:59PM +, John O'Hagan wrote: > in other words, treating backreferences as pseudo-variables, but it > doesn't, AFAIK. Use the right tool for the job. If you want to treat grouped matches as variables, use perl because perl explicitly supports this: $ echo foob