Start a new topic

Using regex to translate phone #

Some of our donors enter phone # like 4164164416 or 416-416-4416.How can I use regex to change them to or format (416)416-4416 when I import to RE. 

Hi Amanda,

I got it, it works. Thank you Amanda.

Sandra

Hi Sandra,

Delete the entry by highlighting the --BLANK-- and hitting delete on your keyboard.

Then place your cursor in the Replacement Values box, and hit Enter. This will give you an entry for -- BLANK -- (by just pressing Enter or the + button, you'll get the entry with the spaces). Now you can add the Values to Match on of \D.

Remember to check the box to "Use Regular Expressions".

Please let me know if it's still not translating properly.

Thank you,
Amanda
Omatic Support
I tried to use the dictionary:

Replacement Value: --BLANK-- (just press the + in the Replacement value to get the BLANK value)
Value to match on:\D

But RE did not apply the phone number formatting set up

I got
416--BLANK--416--BLANK--4416

Please help, Many thanks,
Sandra
Thanks Amy and Amanda. It works now.Same as Amy's
Hi Catherine,

Please double click to open the Values to match on. Place your cursor in the field and make sure there aren't any extra spaces at the beginning or end of the string. It may help to copy and paste it again, making sure there aren't any extra spaces anywhere.

If you're still having trouble with this dictionary, please export and send it to support@omaticsoftware.com so I can take a look at it. To export the dictionary, right click and choose export dictionary. This will create a .csv file that you can send as an attachment.

Thank you!
Amanda
Omatic Support
No, it didn't split

Hi Catherine,

The string isn't being split into the two pieces as it is below?

image


Thank you,
Amanda
Omatic Support

Hi Amanda:

It doesn't work to use second one. Maybe we use it wrong way. the first one works.

Catherine
Hi Amy,

You should only need the second one since it includes both upper and lower case letters. Then the uppercase function in the profile will convert the letters to uppercase.

Please let me know if you're still having trouble with this one.

Thank you,
Amanda
Omatic Support
Hi Amy,

Great question! This one should work:

(^[aA-zZ]{1}\d{1}[aA-zZ]{1}(?=\d{1}[aA-zZ]{1}\d{1}))((?
Then apply the Uppercase function on the row as well. This is the column just to the right of the dictionary column.

Thank you,
Amanda
Omatic Support
Hi Catherine,

This should work for you:

Replacement Value: $1 $2
Value to match on: (^[A-Z]{1}\d{1}[A-Z]{1}(?=\d{1}[A-Z]{1}\d{1}))((?\d{1}[A-Z]{1})\d{1}[A-Z]{1}\d{1}$)

This will look for a format of letter number letter number letter number, just in case you have other zip codes for other countries.

Don't forget to check the "Use regular expressions" checkbox. Please let me know if you have any questions! 


Thank you,
Amanda
Omatic Support

Hi:

Does anybody know how to translate postal code from M8V2E7 to M8V 2E7? Adding space.

Thanks!

Shouldn't RE already do this if you have set up the format on the phone type you are importing?

It works. Thank you.

Hi Catherine,

Did you check the "Use Regular Expressions" checkbox? Following Amanda's suggestion worked on my machine:

image

Login or Signup to post a comment