regex - Regular expression selection of last two folder path names -


im working in perl having issues cutting out other folder names leave last 2 folder names.

trainings , events general office\archive general office\office opperations\contacts general office\office opperations\office procedures\how tos public_html\accordion\.svn\tmp\text-base 

i remove folder path names folders end last 2 path names each:

trainings , events general office\archive office opperations\contacts office procedures\how tos tmp\text-base office opperations\contacts 

ive read other stackoverflow showed last 2 folder names picked out, cannot reverse expression. (i link if can find it)

i using sublime text 3 test expressions.

thank you

the pattern want is

s/.+\/(.+\/.+)$/$1/g 

it'll grab last bit of folder name , replace whole string it.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -