Skip to content

Commit

Permalink
Merge pull request #91 from cuenca-mx/clean-phone
Browse files Browse the repository at this point in the history
fix just clean correct way
  • Loading branch information
alexviquez committed May 26, 2020
2 parents fbd2892 + d913fd2 commit c5c14ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arcusd/arcusactions.py
Expand Up @@ -29,7 +29,7 @@ def unit_to_cents(unit: float) -> int:


def clean(value: str) -> str:
return re.sub(r'\D', '', value)
return re.sub(r'[\W_]+', '', value)


def amount_to_unit(cents: int) -> float:
Expand Down
1 change: 1 addition & 0 deletions tests/test_arcusd.py
Expand Up @@ -13,3 +13,4 @@ def test_clean_phone_number():
assert clean('(555) 555 5555') == '5555555555'
assert clean('555-555') == '555555'
assert clean('555?444') == '555444'
assert clean('-.-5544MMCCXX**''') == '5544MMCCXX'

0 comments on commit c5c14ac

Please sign in to comment.