Compute V1 Client - Class RegexRewrite (2.14.1)

Reference documentation and code samples for the Compute V1 Client class RegexRewrite.

The spec for modifying the path using a regular expression.

Generated from protobuf message google.cloud.compute.v1.RegexRewrite

Namespace

Google \ Cloud \ Compute \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ path_pattern string

Required. The regular expression used to match against the URL path. It uses RE2 syntax with the following constraints: - Any single character operators - Groups are allowed to have only submatch operator inside - Groups are allowed only without any char repetition, e.g. .* - Any char repetition, e.g. .*, is only allowed to be used in a single regex together with: - Empty string operators - Other repetitions - Ranges - Repetitions of ranges - Ranges are only allowed to have: - Character range - Digits range - Symbols listed in characters allowed for ranges

↳ path_substitution string

Required. Required when path pattern is specified. Used to rewrite matching parts of the path.

getPathPattern

Required. The regular expression used to match against the URL path.

It uses RE2 syntax with the following constraints:

  • Any single character operators
  • Groups are allowed to have only submatch operator inside
  • Groups are allowed only without any char repetition, e.g. .*
  • Any char repetition, e.g. .*, is only allowed to be used in a single regex together with:
    • Empty string operators
    • Other repetitions
    • Ranges
    • Repetitions of ranges
  • Ranges are only allowed to have:
    • Character range
    • Digits range
    • Symbols listed in characters allowed for ranges
Returns
Type Description
string

hasPathPattern

clearPathPattern

setPathPattern

Required. The regular expression used to match against the URL path.

It uses RE2 syntax with the following constraints:

  • Any single character operators
  • Groups are allowed to have only submatch operator inside
  • Groups are allowed only without any char repetition, e.g. .*
  • Any char repetition, e.g. .*, is only allowed to be used in a single regex together with:
    • Empty string operators
    • Other repetitions
    • Ranges
    • Repetitions of ranges
  • Ranges are only allowed to have:
    • Character range
    • Digits range
    • Symbols listed in characters allowed for ranges
Parameter
Name Description
var string
Returns
Type Description
$this

getPathSubstitution

Required. Required when path pattern is specified. Used to rewrite matching parts of the path.

Returns
Type Description
string

hasPathSubstitution

clearPathSubstitution

setPathSubstitution

Required. Required when path pattern is specified. Used to rewrite matching parts of the path.

Parameter
Name Description
var string
Returns
Type Description
$this