How to remove folder names from a file path using regex in javascript

Nihar Ranjan Das

Example: c:/users/images/logo.png to logo.png c:\users\images\logo.png to logo.png

Ankit Dabhi
var filename = fullPath.replace(/^.*[\\\/]/, '')

try above this may help to get file name from any path this will support / OR \ both

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how to remove file/folder path from string using regex

How to remove the path in the column names from a text file in linux?

Remove folder names from the URL using htaccess

How to delete files from a folder using a list of file names in windows?

How to get the last folder name and file name from a path using JavaScript?

How to remove characters from the names of files in a folder?

How to remove a file from folder

Remove codes from city names using regex

How to remove characters from file names using command line?

How to select only numbers from file names in bash using regex

Remove specific special character from multiple file names under windows folder using batch script

how to take a path name and remove the final two folder names

how to remove folder path from a string in python

How to get file names from a SharePoint folder

How to fetch the folder or files names from an absolute path in a tree View using JavaFX?

How to remove duplicates from text using regex, match and exec in javascript

How to extract folder from file path

How to get file path from folder wpf?

How to remove URI encoding from file names?

String from file names - How remove the extension?

How to remove a number from file names?

Remove everything from file names except for a particular part taken by RegEx

how to remove blank text file from folder?

How do you quickly remove underscores from folder names?

How to write a data as file names in a folder to CSV file using Nodejs

How to get the file name from a full path using JavaScript?

remove line comment from file by using regex

Using sed with regex to remove text from a file

Regex Exclude folder from path