Skip to content

Commit

Permalink
Merge pull request #102 from RackReaver/update-american-social-securi…
Browse files Browse the repository at this point in the history
…ty-number

Update American Social Security Number.
  • Loading branch information
bee-san authored Jun 26, 2021
2 parents f028579 + 7949e71 commit 4224dff
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,19 +703,19 @@
]
},
{
"Name": "American Social Security Number",
"Regex": "^[0-9]{3}-[0-9]{2}-[0-9]{4}$",
"plural_name": false,
"Description": "An [#CAE4F1][link=https://en.wikipedia.org/wiki/Social_Security_number]American Identification Number[/link][/#CAE4F1]",
"Rarity": 0.2,
"URL": null,
"Tags": [
"Credentials",
"Password",
"Username",
"SSN"
]
},
"Name": "American Social Security Number",
"Regex": "^([0-9][0-9][0-9])(?<!666|000|9[0-9][0-9])(=|\\+|_|\\#|:|;|\\.|-|\\s){0,3}([1-9][1-9]|0[1-9]|[1-9]0)(=|\\+|_|\\#|:|;|\\.|-|\\s){0,3}([0-9][0-9][0-9][0-9])(?<!0000)(=|\\+|_|\\#|:|;|\\.|-|\\s){0,3}?$",
"plural_name": false,
"Description": "An [#CAE4F1][link=https://en.wikipedia.org/wiki/Social_Security_number]American Identification Number[/link][/#CAE4F1]",
"Rarity": 0.5,
"URL": null,
"Tags": [
"Credentials",
"Password",
"Username",
"SSN"
]
},
{
"Name": "Key:Value Pair",
"Regex": "[^:\\s]+[ ]?:[ ]?[^:\\s]+",
Expand Down
54 changes: 54 additions & 0 deletions tests/test_regex_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,60 @@ def test_ssn():
assert "Social" in str(res)


def test_ssn2():
r = regex_identifier.RegexIdentifier()
res = r.check(["001:01:0001"])
assert "Social" in str(res)


def test_ssn3():
r = regex_identifier.RegexIdentifier()
res = r.check(["001.01.0001"])
assert "Social" in str(res)


def test_ssn4():
r = regex_identifier.RegexIdentifier()
res = r.check(["001 01 0001"])
assert "Social" in str(res)


def test_ssn5():
r = regex_identifier.RegexIdentifier()
res = r.check(["900-01-2222"])
assert "Social" not in str(res)


def test_ssn6():
r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "Social" not in str(res)


def test_ssn7():
r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "Social" not in str(res)


def test_ssn8():
r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "Social" not in str(res)


def test_ssn9():
r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "Social" not in str(res)


def test_ssn10():
r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "Social" not in str(res)


def test_cors():
r = regex_identifier.RegexIdentifier()
res = r.check(["Access-Control-Allow: *"])
Expand Down

0 comments on commit 4224dff

Please sign in to comment.