Jump to content

Workflow to add colon symbol to string


Recommended Posts

Posted

Hello,

I'm looking on a workflow to copy a specific string (12 character/digits) with no symbols in it, transform it in the same string but adding a colon symbol ( : ) every 2 characters.

Is it possible via workflow or via Text Expander/Replace utility?

I have no clue on how to start! Thank you!

Posted

I'm not entirely sure what your desired result looks like. An example would be helpful.

I assume you are looking for this: 

h3llog00dbye -> h3:ll:og:00:db:ye

 

You can do that with RegEx:

(.{2})(?!\b)

Replacing the captured groups with

$1:

 

You can use the "Replace" utility for that. 

image.thumb.png.ece2c73372819efe8f983033546e3614.png

 

See also: https://regex101.com/r/tZMJDZ/1

 

Posted
19 hours ago, zeitlings said:

I'm not entirely sure what your desired result looks like. An example would be helpful.

I assume you are looking for this: 

h3llog00dbye -> h3:ll:og:00:db:ye

 

You can do that with RegEx:

(.{2})(?!\b)

Replacing the captured groups with

$1:

 

You can use the "Replace" utility for that. 

image.thumb.png.ece2c73372819efe8f983033546e3614.png

 

See also: https://regex101.com/r/tZMJDZ/1

 

Hello! Thank you! Is it possible to filter this for only 12-digits/chars elements in the current clipboard? 

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...