Taking First & Last Name from Clipboard and creating FLast or flast

Hello,

New Text Blaze user here. I was hoping to build on this regex example so that I could copy names, First Last and have it give me first initial, last name without the white space, i.e. FLast or flat

The first name is: {=extractregex({clipboard}, "(.+?) ")}
The last name is: {=extractregex({clipboard}, ".+? (.+)")}

Any help appreciated

Hi @David_Morgan and welcome to the forum.

You mean something like this?

{fullname="Bruce Lee"}

The first name is: {=extractregex(fullname, "(.+?) ")}
The last name is: {=extractregex(fullname, ".+? (.+)")}

{=extractregex(fullname, "(.+?)")&extractregex(fullname, ".+? (.+)")}

2 Likes

Not 100% but you got me in the right direction!

The first name is: {=extractregex({clipboard}, "(.+?) ")}
The last name is: {=extractregex({clipboard}, ".+? (.+)")}
The user name is: {=extractregex({clipboard}, "(.+?)")&extractregex({clipboard}, ".+? (.+)")}

1 Like

Great. Glad I could help! Honestly, I've always struggled with regex lol.

By the way, not sure how your getting the first and last name, but if you're getting them from a website, you can use {site: text; selector=} to read the data from the selector on the Web page directly, without having to copy it manually to the clipboard.

That's an interesting function that I will have to look into. I am doing a highlight and ctrl-c on First and Last name from a service desk ticket and then automating account creation in a different tab, which works fantastic BTW.