Jump to content

Switch Word Order - Transform Modifiers


Recommended Posts

What is a simple workflow that I can use to trigger keyboard shortcut to copy FirstName LastName and change it to LastName, FIrstName?

 

I think that this can somehow be done with Transform Modifiers but I can't figure out how they work yet.

 

Another option is to use RegEx to Find "([\w\.\-]+)\h+([\w\.\-]+)(.*)" and replace with "$2, $1"

Link to comment
10 hours ago, slyfox said:

I think that this can somehow be done with Transform Modifiers but I can't figure out how they work yet.

 

It can't. You want a Replace utility and a regex.

 

I'm not sure about the logic of your regex, though. I don't think you can possibly write a regex that handles all names correctly due to different conventions, but I think a sounder approach for English names would be to find the last space in the name and treat everything after that as the last name and everything before as the first name. Something like (.+)\s(.*).

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...