I am trying to achieve the following match
Enter
123-45-6789 123456789 1234
Reg Ex (s) Tried with the output:
\d{5}
123-45-6789
12345 6789
1234
\d{2,3}
123 - 45 - 678 9
123456789
123 4
\d{3}-{0,1}\d{2}
123-45 -6789
12345 6789
1234
I need to provide this regular expression to replace the method, and I do not want to replace the " - ", it should replace only the first 5 digits without changing the format:
Expected Result
123 - 45 -6789
12345 6789
1234
EDIT
In the above examples, the outputs are:
1> all mapped to global regex 2> Bold numbers are expected to match
goal
I need to hide the SSN, for example: 444-55-6666 becomes ### - ## - 6666 and 444556666 becomes ##### 6666. Without format restriction.
source share