Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: Regex to get file name from the path with spaces

by choroba (Cardinal)
on Sep 08, 2021 at 09:53 UTC ( [id://11136566]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Regex to get file name from the path with spaces
in thread Regex to get file name from the path with spaces

You're missing the negation ^ in the character class. Also, you're using forward slashes in the regex, but backslashes in the string. Moreover, I'm not sure the ? is needed.
#! /usr/bin/perl use strict; use warnings; use utf8; my $input = 'TEXT: "C:\temp\test äbc.txt"'; print $input =~ /.*TEXT:\s+".*[\\]([^\\"]+)"/; # ~ ~ ~ ~
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11136566]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found