Please help me with my REGEX. Currently, we have code that replaces words/patterns. If I type in only the SSN like 123-12-1234
. It will be replaced by ***********
. However, if I type in "My SS# is 123-12-1234"
it will not work since its part of a sentence. I am not sure why my regex does not match this. Here it is:
^(?!(000|666|9))d{3}-(?!00)d{2}-(?!0000)d{4}$^(?!(000|666|9))d{3},(?!00)d{2},(?!0000)d{4}$
I tried using other regex such as : /bd{3}-d{2}-d{4}b/g
but this does not work as well.
expected behavior is to match any pattern even if its in a sentence or paragraph.