RegexFullMatch#
Domain:
ai.onnxSince version: 20
RegexFullMatch performs a full regex match on each element of the input tensor. If an element fully matches the regex pattern specified as an attribute, the corresponding element in the output is True and it is False otherwise. RE2 regex syntax is used.
Inputs
X (T1): Tensor with strings to match on.
Outputs
Y (T2): Tensor of bools indicating if each input string fully matches the regex pattern specified.
Type Constraints
T1: Inputs must be UTF-8 strings Allowed types: tensor(string).
T2: Outputs are bools and are True where there is a full regex match and False otherwise. Allowed types: tensor(bool).
Examples#
test_cc_regex_full_match_basic
Node:
RegexFullMatch(x) -> (y)
Attributes:
pattern = "www\.[\w.-]+\.\bcom\b"
Inputs:
x: shape=(3,), dtype=object
['www.google.com', 'www.facebook.com', 'www.bbc.co.uk']
Outputs:
y: shape=(3,), dtype=bool
[ True, True, False]
test_cc_regex_full_match_email
Node:
RegexFullMatch(x) -> (y)
Attributes:
pattern = "[A-Za-z0-9_.+-]+@[A-Za-z0-9-]+\.[A-Za-z0-9-.]+"
Inputs:
x: shape=(2, 2), dtype=object
[['account@gmail.com', 'not_an_email'],
['x@y.z', '@nope']]
Outputs:
y: shape=(2, 2), dtype=bool
[[ True, False],
[ True, False]]
test_cc_regex_full_match_email_domain
Node:
RegexFullMatch(x) -> (y)
Attributes:
pattern = "(\W|^)[\w.\-]{0,25}@(yahoo|gmail)\.com(\W|$)"
Inputs:
x: shape=(2, 2), dtype=object
[['account@gmail.com', 'account@hotmail.com'],
['not email', 'account2@yahoo.com']]
Outputs:
y: shape=(2, 2), dtype=bool
[[ True, False],
[False, True]]
test_cc_regex_full_match_empty
Node:
RegexFullMatch(x) -> (y)
Attributes:
pattern = "abc"
Inputs:
x: shape=(0,), dtype=object
[]
Outputs:
y: shape=(0,), dtype=bool
[]