Re: regular expression help

2012-09-20 Thread Dr.Ruud
On 2012-09-20 09:08, Octavian Rasnita wrote: my ( $file_name ) = $data =~ /([^\\]+)$/g; No need for that g-modifier. -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: authentication & maintaining state

2012-09-20 Thread Bill Stephenson
On Sep 19, 2012, at 8:38 PM, Bill Stephenson wrote: > I want my scripts to maintain state when a user's session expires. > > When that happens I send them to a login page and here's what I am working on > in the module that does the authentication: Well, after a bit more research I can't see ho

Re: regular expression help

2012-09-20 Thread Irfan Sayed
thanks a lot for all the responses :) regards From: Shlomi Fish To: Michael Brader Cc: beginners@perl.org Sent: Thursday, September 20, 2012 2:53 PM Subject: Re: regular expression help On Thu, 20 Sep 2012 17:13:07 +0930 Michael Brader wrote: > A more

Re: regular expression help

2012-09-20 Thread Shlomi Fish
On Thu, 20 Sep 2012 17:13:07 +0930 Michael Brader wrote: > A more idiomatic way to do this is to use the File::Spec module. > Inspect the output of this program for inspiration: > There's also File::Basename: http://perldoc.perl.org/File/Basename.html Regards, Shlomi Fish -- --

Re: regular expression help

2012-09-20 Thread Michael Brader
On 09/20/2012 04:39 PM, Irfan Sayed wrote: got it myself :) thanks a lot $line_to_add =~ m/([a-zA-Z]+\.csproj)/; Hi Irfan, Your solution will only match files that consist of ASCII alphabetic characters followed by '.csproj'. It will also match these: * 'c:\p4\car\abc\foo.csproj\file.tx

Re: regular expression help

2012-09-20 Thread Irfan Sayed
got it myself :) thanks a lot  $line_to_add =~ m/([a-zA-Z]+\.csproj)/; regards From: Irfan Sayed To: Perl Beginners Sent: Thursday, September 20, 2012 12:07 PM Subject: regular expression help i have string 'c:\p4\car\abc\xyz.csproj' i just need to matc

Re: regular expression help

2012-09-20 Thread Octavian Rasnita
From: "Irfan Sayed" i have string 'c:\p4\car\abc\xyz.csproj' i just need to match the xyz.csproj i tried few option but does not help. can someone please suggest regards irfan my $data = 'c:\p4\car\abc\xyz.csproj'; my ( $file_name ) = $data =~ /([^\\]+)$/g; print $file_name; It will p