Learn Before
Code
RegEx [] Code Example
import re txt = "xyz" #Check if txt has any a, b, or x characters: x = re.findall("[abx]", txt) print(x) if x: print("Match!") else: print("No match") #Since txt contains "x", it will print "Match!"
0
1
Updated 2021-08-24
Tags
Python Programming Language
Data Science