Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda