Re: [Perl-unix-users] Need help for regular expression problem

2009-12-08 Thread Brian Raven
walter.l...@schwindt.eu <> wrote: > Hello, > > I have the following strings: > TEST1=/bla/\${var1}/bla/${var2}a${var3}/bla > TEST2=/bla/\${var1}/bla/${var2}${var3}/bla > > I want to transform them: > TEST1=/bla/\$ENV{var1}/bla/$ENV{var2}a$ENV{var3}/bla > TEST2=/bla/\$ENV{var1}/bla/$ENV{var2}$ENV{

Re: [Perl-unix-users] Need help for regular expression problem

2009-12-08 Thread Matt Schneider
Walter, I have not tested this but I believe your problem is the greedy matching. It is matching from one { to the furthest } it can. I am guessing that \w is matching those internal }{ and the $ which I don't think it should but they might be ignored because they are generally meta characters.