Skip to content

Regular Expressions and Text Pre-processing (15)

Basic Identification of Pattern (2)

Short Description Function
Check for existence of a pattern re.contains
Count occurrences of a pattern re.count

Get Matched Patterns (2)

Short Description Function
Find the first instance of a pattern re.findfirst
Find all instances of a pattern re.findall

Get Matched Groups (2)

Short Description Function
Get first set of matching groups re.groups
Get all sets of matching groups re.groupsall

Get Matched Patterns and Groups (2)

Short Description Function
Find the first instance of a pattern, with groups re.findgroupsfirst
Find all instances of a pattern, with groups re.findgroupsall

Get Index Position of Match (3)

Short Description Function
Find the first index where a pattern appears re.index
Find the last index where a pattern appears re.rindex
Find all indexes that match a pattern re.indexall

Replacement (3)

Short Description Function
Replace the first instance of a pattern re.replacefirst
Replace the last instance of a pattern re.replacelast
Replace all instances of a pattern re.replaceall

Splitting (1)

Short Description Function
Split a string by a pattern re.split