How can I make this Perl regex work?

Posted by Geo on Stack Overflow See other posts from Stack Overflow or by Geo
Published on 2010-06-10T17:10:50Z Indexed on 2010/06/10 17:12 UTC
Read the original article Hit count: 291

Filed under:
|

I have this line ( it's a single line, SO makes it seem like 2 ):

/Od /D "WIN32" /D "_DEBUG" /FD /EHa /MDd /Fo"Debug" /Fd"Debug\vc80.pdb" /W3 /c /Zi /clr /TP .\main.cpp"

And I want to extract the .\main.cpp. I thought the following would do the trick:

if($string =~ /.*\s+(.*)$/i) {
    print "matched ",$1,"\n";
}

because this same regex works in Ruby, and extracts the string I required. How can I get it working?

© Stack Overflow or respective owner

Related posts about regex

Related posts about perl