Based upon your expression I'm still not sure how it works. You have
the first ".*" which says 0 or more periods. Then you escape the slash
to look for a "\" then the "(.+)" match 1 or more periods and then you
escape both @@'s individually. So I still don't understand how the
".*" and the "(.+)" are used. Also, how does this say give me the
contents between the \ and the @@. I have read the reference pages
before and after this post. Could you shed some light on the
reasoning? I'm sure once you explain it regular expression will be
easier to comprehend.
..\Source\CPP\ConnPool\src\oraUtils.pc@@ (source)
Thanks
Gunnar Hjalmarsson <> wrote in message news:<3S4xb.39420$>...
> EFP wrote:
> > Sample Units.txt data:
> > .\Source\CPP\ConnPool\src\oraUtils.pc@@
>
> <snip>
>
> > I just want the:
> > oraUtils.pc
>
> <snip>
>
> > So basically I want the contents between "\" and the "@@"
> >
> > I thought that:
> > $string =~ m/\*@@\$/;
> >
> > Would go to the end of the search line and find "@@" and get
> > anything "*" between the "@@" and the "\" and set $string to this
> > new value.
>
> What on earth made you think that??
>
> > Can anyone correct my understanding of regular expression and
> > assignment to a varibale.
>
> Yes, you can do that. By studying the Perl documentation for regular
> expressions:
>
> http://www.perldoc.com/perl5.8.0/pod/perlre.html
>
> This would do what you want:
>
> ($string) = $string =~ /.*\\(.+)\@\@/;
>
> But please use the docs to get an understanding of how it works.