Regular Expressions in Python

Start Free Preview

Buying via our links supports this free directory · Affiliate disclosure.
Course facts
  • Payment: Free Preview (Paid Upgrade)
  • Learning style: Self-paced, start anytime
  • Format: Text & Interactive
  • Video access: Streaming Only
  • Before you start: Intermediate Python
DataCamp details
  • Chapters: 4
Created byDataCamp
Available onDataCamp

Course Details
Learning Style

Start Anytime

Level

Beginner

Study Mode

100% Online

Duration

Short (< 10 Hours)

Languages
Audio Language

English

Outcomes
Certificate

Certificate of Completion

Price & Terms
Pricing Model

Free Preview (Paid Upgrade)

Technical
Content Medium

Text & Interactive

Video Access

Streaming Only

Specification
Access

Subscription

SKU: regular-expressions-python Category: Tags: , Brand:

Learn to clean, format and search text in Python, then write regular expressions with groups, backreferences and lookaround on real tweets and reviews.

At a glance
Duration4 hrs
LevelBeginner
CertificateCertificate of Completion
LanguageEnglish
AccessSubscription
Add your review
Add to wishlistAdded to wishlistRemoved from wishlist 0
Add to compare

You learn to detect, extract, replace and match the parts of a string you need with regular expressions in Python. The work happens on messy text such as movie reviews, streamed tweets and pages scraped off the web, where cleaning strings and pulling out key details is a step that comes before any machine learning on the data. Along the way you also split, join and interpolate strings with Python’s built-in tools.

What You Will Achieve

  • Clean and normalize text reviews by adjusting case, stripping stray spaces and swapping out unwanted words
  • Insert values into report text and pick the formatting approach that suits the task
  • Write patterns that pull numbers, email addresses and file names out of raw tweets and text
  • Filter phone numbers, catch repeated characters and check that tags close properly using grouped patterns


Program Overview

Core String Manipulation

Basic operations practiced on a movie review dataset, covering how strings are cut, combined, cleaned and searched.

  • Slicing, concatenating and palindromes
  • Adjusting case and removing spaces
  • Joining strings and splitting lines
  • Finding and replacing substrings

String Formatting Approaches

Three ways to place values inside strings, tried on text scraped off the web and weighed for their advantages and disadvantages.

  • Positional formatting and named placeholders
  • Formatted string literals
  • The Template method
  • Preparing a report and identifying prices

Regular Expression Syntax and Advanced Pattern Matching

Pattern matching on tweets meant for sentiment analysis, followed by grouping, backreferences and lookaround for more complex matches.

  • Metacharacters, repetitions and splitting on matches
  • Greedy versus lazy quantifiers
  • Capturing groups, non-capturing groups and alternation
  • Backreferences and lookaround

Certificate Awarded (Paid)


Job Outlook

Cleaning strings and matching patterns with regular expressions is routine in data science work, especially when preparing text corpora for text mining and machine learning, and in everyday Python programming.


Our take

Good for: Python users who handle text data and want a structured path through string methods before working with regex syntax and its trickier features.

Keep in mind: Only the second half is about regular expressions; the first two chapters cover plain string methods and formatting, which is useful groundwork rather than regex itself.

Bottom line: Each regex idea is tied to a concrete text task, such as pulling emails out of tweets or filtering phone numbers.

Frequently Asked Questions

What datasets do the exercises use?

String manipulation is practiced on a movie review dataset, formatting on information scraped off the web, and pattern matching on a set of streamed tweets meant for sentiment analysis. Later exercises also parse text taken from PDF files.

Where do regular expressions fit in a data science workflow?

They belong to text mining: extracting key information from large bodies of text, cleaning messy string data and detecting useful words. This preparation happens before machine learning algorithms are applied to the text.

Does it cover lookahead and lookbehind assertions?

Yes. The final chapter treats lookaround alongside backreferences and capturing groups, with exercises that find surrounding words and filter phone numbers using these assertions.

User Reviews

0.0 out of 5
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0

No reviews yet. Be the first to review this course.

There are no reviews yet.

Write your review

Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.

×

    Report this page
    Regular Expressions in Python
    Regular Expressions in Python
    LiveTalent
    Logo
    Compare items
    • Total (0)
    Compare
    0