Teradata Package for Python Function Reference on VantageCloud Lake - rlike - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.
Teradata® Package for Python Function Reference on VantageCloud Lake
- Deployment
- VantageCloud
- Edition
- Lake
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.08
- Published
- November 2025
- ft:locale
- en-US
- ft:lastEdition
- 2025-12-05
- dita:id
- TeradataPython_FxRef_Lake_2000
- Product Category
- Teradata Vantage
- teradataml.dataframe.sql.DataFrameColumn.rlike = rlike(self, pattern, case_sensitive=True)
- DESCRIPTION:
Function to match a string against a regular expression pattern.
PARAMETERS:
pattern:
Required Argument.
Specifies a regular expression pattern to match against the column values.
Note:
The pattern follows POSIX regular expression syntax.
Type: str OR ColumnExpression
case_sensitive:
Optional Argument.
Specifies whether the pattern matching is case-sensitive.
When set to False, the function ignores case sensitivity and matches
the regex. Otherwise, function considers case sensitivity while matching regex.
Default: True
Type: bool
RAISES:
TeradataMlException
RETURNS:
ColumnExpression
EXAMPLES:
>>> load_example_data("dataframe","admissions_train")
>>> df = DataFrame("admissions_train")
>>> df
masters gpa stats programming admitted
id
13 no 4.00 Advanced Novice 1
26 yes 3.57 Advanced Advanced 1
5 no 3.44 Novice Novice 0
19 yes 1.98 Advanced Advanced 0
15 yes 4.00 Advanced Advanced 1
40 yes 3.95 Novice Beginner 0
7 yes 2.33 Novice Novice 1
22 yes 3.46 Novice Beginner 0
36 no 3.00 Advanced Novice 0
38 yes 2.65 Advanced Beginner 1
# Example 1: Find records whose 'stats' column contains 'van'.
>>> result = df[df.stats.rlike('.*van.*')]
>>> result
masters gpa stats programming admitted
id
13 no 4.00 Advanced Novice 1
26 yes 3.57 Advanced Advanced 1
34 yes 3.85 Advanced Beginner 0
19 yes 1.98 Advanced Advanced 0
15 yes 4.00 Advanced Advanced 1
36 no 3.00 Advanced Novice 0
38 yes 2.65 Advanced Beginner 1
# Example 2: Find records whose 'stats' column ends with 'ced'.
>>> result = df[df.stats.rlike('.*ced$')]
>>> result
masters gpa stats programming admitted
id
34 yes 3.85 Advanced Beginner 0
32 yes 3.46 Advanced Beginner 0
11 no 3.13 Advanced Advanced 1
30 yes 3.79 Advanced Novice 0
28 no 3.93 Advanced Advanced 1
16 no 3.70 Advanced Advanced 1
14 yes 3.45 Advanced Advanced 0
# Example 3: Case-insensitive search for records containing 'NOVICE'.
>>> result = df[df.stats.rlike('NOVICE', case_sensitive=False)]
>>> result
masters gpa stats programming admitted
id
12 no 3.65 Novice Novice 1
40 yes 3.95 Novice Beginner 0
7 yes 2.33 Novice Novice 1
5 no 3.44 Novice Novice 0
22 yes 3.46 Novice Beginner 0
37 no 3.52 Novice Novice 1