Start a new topic

Regular Expressions - Inserting Characters

I need to insert hyphens into an eight (8) digit employee ID number.  For example, if my employee ID is 12345678, I need it to import as 123-45-678.  This would be very similar to adding a hyphen into a nine (9) digit SSN.
1 Comment

Hey Patrick,

I was curious about this one, so found this after some googling: 
http://www.aspfaqs.com/webtech/031302-1.shtml

Using their phone formatting RegEx as a guide, I was able to come up with this:

image



The replacement value is: $1-$2-$3
The values to match on are: (\d{3})(\d{2})(\d{3})

Enjoy!

Jeff
Login to post a comment