Start a new topic

RegEx Dictionary - Create a cipher

Is it possible to create a simple cipher or code with RegEx? If we wanted to assign letters certain numbers and then translate them back?


Ex:

A = 0

B = 1

C =2 

etc.


Then translate 'ABC' to '012'


It should be -- it's just it might be a little tedious to build, and a lot tedious to maintain.

Example (currently looking at the replacement value for "a")

image



replacement value for "b"

image


and "c":

image


So that's a separate RegEx rule for each letter.  But it works:

image


To reverse it, you would need another dictionary where the roles of the letters and digits are reversed.

as long as it's single digit, single letter, it's probably ok.

This is perfect! Thank you so much. 

Login or Signup to post a comment