Learn Before
Code
RegEx ^ Code Example
import re #Check if txt starts with "1Cademy": txt = "1Cademy is super cool" pattern = "^1Cademy" x = re.search(pattern, txt) if x: print("Match!") else: print("No match") #Since txt starts with 1Cademy, it prints "Match!"
0
1
Updated 2021-08-24
Tags
Python Programming Language
Data Science