Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScanPDF: Modification of regex throwing warning #252

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

phutelmyer
Copy link
Contributor

@phutelmyer phutelmyer commented Dec 20, 2022

Describe the change
Update phone_number regular expression in ScanPDF to fix warning observed during tests:

=============================== warnings summary ===============================
scanners/scan_pdf.py:14
  /strelka/strelka/scanners/scan_pdf.py:14: DeprecationWarning: invalid escape sequence '\+'
    "\+?(?:\d{1,2})?\s?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{2,4}?\-?\d{2,4}?",

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== 31 passed, 1 warning in 5.27s =========================

The updated regular expression will match phone numbers that are formatted in a variety of ways, including:

+1 (123) 456-7890
(123) 456-7890
123-456-7890
123 456 7890
123.456.7890

Describe testing procedures
Submitted several PDFs with phone numbers to Strelka.

Sample output
N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of and tested my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@phutelmyer phutelmyer self-assigned this Dec 20, 2022
@phutelmyer phutelmyer added the bug Something isn't working label Dec 20, 2022
@phutelmyer phutelmyer changed the title Modification of regex throwing warning ScanPDF: Modification of regex throwing warning Dec 20, 2022
@phutelmyer phutelmyer merged commit 405e046 into master Dec 20, 2022
@phutelmyer phutelmyer deleted the scanpdf-regex-update branch December 30, 2022 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant