Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by Corion (Patriarch)
on Sep 08, 2021 at 07:48 UTC ( #11136555=note: print w/replies, xml ) Need Help??


in reply to Regex to get file name from the path with spaces

Maybe you want to instead capture everything up to the second double quote?

.*TEXT:\s+"([^"]+)"

If you have both, lines with and lines without double quotes, you will have to show more data.

Update: After reading haukex answer, I now realize that I only understood half of your question. Use my answer to extract the full path and then use File::Spec to get the actual filename.

Replies are listed 'Best First'.
Re^2: Regex to get file name from the path with spaces
by szpt9m (Novice) on Sep 08, 2021 at 08:09 UTC
    Hi, I dont need everything upto second double quote but i need last part of the line after / which is the path name. and i need this in regex only so that i can adapt the existing code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2022-01-19 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?