Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

237
Visualizações
How to redact possible phone number in string?

I am use Google Cloud DLP (node.js) for redact phone number from string (this string can contain other word). https://cloud.google.com/dlp/docs/samples/dlp-inspect-phone-number For example I want redact phone number in: Do transaction over phone to bypass fee. My number: 18776967786

But Cloud DLP only redact phone number with international format. For example +1-877-696-7786

Anyone know good method for iterate through string and redact possible phone number?

Thanks for help!

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

For your specific example, US_TOLLFREE_PHONE_NUMBER works as the infotype.

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório

0

Without format or context you would need to turn on redaction of PHONE_NUMBER and GENERIC_ID with threshold of UNLIKELY 1.

about 4 years ago · Juan Pablo Isaza Relatório

0

As mentioned by @Jordanna Chord, US_TOLLFREE_PHONE_NUMBER works as infotype for given example. And for phone numbers other than US, you can use PHONE_NUMBER as infotype.

Specifying redactConfig redacts a given value by removing it completely. The redactConfig message has no arguments; specifying it enables its transformation. Refer redactConfig for more information.

Redact a given value. For example, if used with an InfoTypeTransformation transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the output would be 'My phone number is '. You can specify one or more infoType transformations per request. Within each InfoTypeTransformation object, you specify both of the following:

  • One or more infoTypes to which a transformation should be applied (the infoTypes[] array object).
  • A primitive transformation (the PrimitiveTransformation object).

The challenge here is that if there's no context and no formatting, then a phone number may just look like a ~10 digit number. If you want to redact phone numbers you should mention the correct format. Or else, turn on redaction of PHONE_NUMBER and GENERIC_ID with a threshold of UNLIKELY to remove even if it is not mentioned in the format.

Example formats:

Item Result Likelihood
18776967786 GENERIC_ID UNLIKELY
877-696-7786 PHONE NUMBER POSSIBLE
877 696 7786 PHONE NUMBER POSSIBLE
+1 877 696 7786 PHONE NUMBER POSSIBLE
+18776967786 PHONE NUMBER POSSIBLE
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda