Phone

org.llm4s.agent.guardrails.patterns.PIIPatterns.PIIType.Phone
case object Phone extends PIIType

Phone numbers: US formats ((XXX) XXX-XXXX, XXX-XXX-XXXX, XXX.XXX.XXXX, with an optional +1 or 1 prefix) and international numbers written with a leading +: the country code and the rest, 8 to 15 digits in all (the E.164 maximum), with spaces, dashes, dots or parentheses between digits (+44 20 7946 0958, +44 (0) 20 7946 0958, +81 3-1234-5678).

An international number needs its +: a plain run of digits is not treated as a phone number unless it has the US shape. A + followed by more than 15 contiguous digits is not matched. With separators, a match ends after at most 15 digits and leaves the rest: +44 20 7946 0958 1234 masks +44 20 7946 0958 and keeps 1234.

A + right after UTC or GMT, with or without a space between (UTC+5, GMT +1, any case), is a time-zone offset, not the start of an international number, so UTC+5 2026-10-09 12:30 is left alone.

Attributes

Source
PIIPatterns.scala
Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait PIIType
class Object
trait Matchable
class Any
Show all
Self type
Phone.type

Members list

Type members

Inherited types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Singleton
Source
Mirror.scala

Attributes

Inherited from:
Singleton
Source
Mirror.scala
type MirroredMonoType = Singleton.this.type

The mirrored *-type

The mirrored *-type

Attributes

Inherited from:
Singleton
Source
Mirror.scala
type MirroredType = Singleton.this.type

Attributes

Inherited from:
Singleton
Source
Mirror.scala

Inherited and Abstract types

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def mask(value: String): String

Attributes

Source
PIIPatterns.scala

Inherited methods

def findAll(text: String): Seq[PIIMatch]

Find all matches of this PII type in text.

Find all matches of this PII type in text.

Attributes

Inherited from:
PIIType
Source
PIIPatterns.scala

Create a new instance of type T with elements taken from product p.

Create a new instance of type T with elements taken from product p.

Attributes

Inherited from:
Singleton
Source
Mirror.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

val name: String

Attributes

Source
PIIPatterns.scala
val pattern: Regex

Attributes

Source
PIIPatterns.scala