help with regular expression

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
dabombst
Posts: 11
Joined: Tue Nov 01, 2005 7:24 pm

help with regular expression

Post by dabombst »

Hi, I have this path that i need only the file name and extension at the end of the path.

example:
\\dct02\abc\Bennett_1_050823\C_Drive1\Documents and Settings\Administrator\NTUSER.DAT

outcome should be...

NTUSER.DAT


Thanks
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Is each path the only text on a line? If so, then this does it:
Find what: .*\\
Replace with: [Nothing]

[X] Regular expression
The regular expression recogniser will find a match that starts as far to the left as possible (i.e., at the beginning of the line) and that is as long as possible (i.e., up to and including the last backslash).
Post Reply