While dealing with special string characters in regular expressions, a raw string is often used because it avoids issues that may arise with those special characters.

Regular expressions are commonly used to match the patterns of phone numbers, email addresses, and web addresses in between the text. Pandas has several string functions that accept regular expression patterns and perform the operation. We are now familiar with these functions: series.str.contains() and series.str.replace().

Now, let's use some more functions in our dataset of comments.

Use series.str.count() to count the occurrences of a pattern in each string, as follows: