Replacing 2 word name with LastNameFirstInitial

A swapping-ground for Regular Expression syntax

Replacing 2 word name with LastNameFirstInitial

Postby parker » Mon Dec 01, 2008 10:49 am

Hi

Sorry for asking what seems like a simple Reg Ex question, but i am new to Reg Ex.

I want rename folders that are named with person's names.
Ex:
John Smith
Harry Jones

I want to replace the existing names with
LastNameFirstInitial
Ex
SmithJ
JonesH
parker
 
Posts: 9
Joined: Mon Dec 01, 2008 10:30 am

Re: Replacing 2 word name with LastNameFirstInitial

Postby jimwillsher » Mon Dec 01, 2008 11:59 am

Something along the lines of:

(.)(.*\s)(.*)
\3\1

should work.


Jim
jimwillsher
 
Posts: 63
Joined: Wed Sep 24, 2008 1:22 pm

Re: Replacing 2 word name with LastNameFirstInitial

Postby parker » Mon Dec 01, 2008 9:36 pm

jimwillsher wrote:Something along the lines of:

(.)(.*\s)(.*)
\3\1

should work.


Jim



Thanks
It works perfectly !
parker
 
Posts: 9
Joined: Mon Dec 01, 2008 10:30 am


Return to Regular Expressions