extracting filename

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

extracting filename

Postby shalindalal » Mon Dec 15, 2003 5:26 pm

I am looking for a regular expression to extract filename (excluding the extension) from a string with the path information of the file.

for e.g.
from:
the/whole/filepath/with/filename.extension
I want to extract "filename"

I would really appreciate any help

Shalin
shalindalal
n00b
n00b
 
Posts: 1
Joined: Mon Dec 15, 2003 5:22 pm

Postby Smite » Mon Dec 15, 2003 5:40 pm

Is this in Newsbin? 'cause Newsbin can't execute regex, only filter by it.
In other programs /.*$ might give you either /whole/filepath/with/filename.extension, or if you're lucky /filename.extension depending on how it parses the string. But you'd need to find a program that supports variables to actually extract the filename, and how that works varies by the program.

I suggest you look for help in a more appropriate place for that program...
User avatar
Smite
Katamari Damacy Addict
 
Posts: 5318
Joined: Sat May 19, 2001 1:54 am
Location: Alberta, Canada

Registered Newsbin User since: 03/27/03


Return to Regular Expressions

Who is online

Users browsing this forum: Google [Bot] and 2 guests