rlike (Column)
SQL RLIKE (regex LIKE) pattern matching.
Syntax
Python
rlike(other)
Parameters
Parameter | Type | Description |
|---|---|---|
| str | Regular expression pattern string |
Returns
Column (boolean)
Examples
Python
df = spark.createDataFrame(
[(2, "Alice"), (5, "Bob")], ["age", "name"])
df.filter(df.name.rlike('ice$')).collect()
Output
# [Row(age=2, name='Alice')]