Documentation

Prefix
in package

Table of Contents

Constants

L2_REGEX_WITH_OPTIONAL_PREFIX  = '/^(AS)?[A-Fa-f\d]{64}$/'
Regular expression for matching a UMID/L2 address with or without the "AS" prefix.

Methods

prefixWithAS()  : string
Ensures a UMID/L2 address has exactly one "AS" prefix. It is idempotent.
removeASPrefix()  : string
Ensures a UMID/L2 address doesn't have an "AS" prefix. It is idempotent.

Constants

L2_REGEX_WITH_OPTIONAL_PREFIX

Regular expression for matching a UMID/L2 address with or without the "AS" prefix.

private mixed L2_REGEX_WITH_OPTIONAL_PREFIX = '/^(AS)?[A-Fa-f\d]{64}$/'

Methods

prefixWithAS()

Ensures a UMID/L2 address has exactly one "AS" prefix. It is idempotent.

public static prefixWithAS(string $umid) : string
Parameters
$umid : string

The UMID/L2 address to check and potentially prefix.

Tags
throws
Exception

if the UMID does not match the regex with or without the prefix.

Return values
string

The UMID/L2 address with the "AS" prefix.

removeASPrefix()

Ensures a UMID/L2 address doesn't have an "AS" prefix. It is idempotent.

public static removeASPrefix(string $umid) : string
APIYes
Parameters
$umid : string

The UMID/L2 address to check and potentially remove the prefix from.

Tags
throws
Exception

if the UMID does not match the regex with or without the prefix.

Return values
string

The UMID/L2 address without the "AS" prefix.


        
On this page

Search results