Skip to content
Snippets Groups Projects
Commit bd45f258 authored by Raman Arora's avatar Raman Arora
Browse files

Eliminate duplicate regex string.

parent 5e1a7390
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ private CommunicationsUtils() {
*
*/
public static String normalizePhoneNum(String phoneNum) throws TskCoreException {
if (phoneNum.matches("\\+?[0-9()\\-\\s]+")) {
if (isValidPhoneNumber(phoneNum)) {
return phoneNum.replaceAll("[^0-9\\+]", "");
} else {
throw new TskCoreException(String.format("Input string is not a valid phone number: %s", phoneNum));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment