•  mrobinson
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
I'm trying to set our forums up to replace social security numbers. I have been successful in getting it to replace a 9 digit number but when posted in the normal format 123-45-6789 I can't get replace to work. I'm sure it's a syntax issue I have wrong. Can someone supply me with the proper syntax please?

I'm sure this question has been asked before but my forum searches yielded nothing.

Thanks in advance!!
Make sure you are escaping special characters in the regex, such as the dash. If you don't properly escape any 'reserved' characters, the regex will fail.
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
  •  mrobinson
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
Wow, fast reply. Much appreciated!!

We just figured it out. Needed to enclose the expression in parenthesis. This one works for 123456789 and 123-45-6789


Thought I'd list the expression for the next person who might search this post.

Thank you for the help. Issue resolved

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved