✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
    • Showing results for:
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics
    • Close
  • Bodie Ponder
    Bodie Ponder
    2,808 Points

    what am I missing? Im on the last question.

    Posted on Feb 8, 2022 by Bodie Ponder
    Bodie Ponder
    2,808 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Terrance McGee
    Terrance McGee
    2,958 Points

    i dont know what im doing wrong

    Posted on Nov 13, 2021 by Terrance McGee
    Terrance McGee
    2,958 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Sinazo Nongena
    Sinazo Nongena
    2,517 Points

    Task 2 of 5 Read the contents of file_object into a new variable named data. May someone please read my code

    Posted on Sep 29, 2020 by Sinazo Nongena
    Sinazo Nongena
    2,517 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • Tim Gast
    Tim Gast
    7,624 Points

    when use the ()

    Posted on Oct 31, 2019 by Tim Gast
    Tim Gast
    7,624 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Emily Strobl
    Emily Strobl
    5,429 Points

    What am i doing wrong

    Posted on Oct 3, 2019 by Emily Strobl
    Emily Strobl
    5,429 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Kudzanai Leroy Mapika
    Kudzanai Leroy Mapika
    3,912 Points

    Import re. Create an re.match() for the word "Four" in the data variable. Assign this to a new variable named first.

    Posted on Aug 26, 2019 by Kudzanai Leroy Mapika
    Kudzanai Leroy Mapika
    3,912 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Mohammed Zvakavapano
    Mohammed Zvakavapano
    1,746 Points

    what code should i Use answer this question -- Use open() to load the file "basics.txt" into the variable file_object.

    Posted on Aug 20, 2019 by Mohammed Zvakavapano
    Mohammed Zvakavapano
    1,746 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Mohammed Zvakavapano
    Mohammed Zvakavapano
    1,746 Points

    Use open() to load the file "basics.txt" into the variable file_object.

    Posted on Aug 20, 2019 by Mohammed Zvakavapano
    Mohammed Zvakavapano
    1,746 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Fineen Davis
    Fineen Davis
    1,281 Points

    data variable appears to not contain the right information

    Posted on Jun 12, 2019 by Fineen Davis
    Fineen Davis
    1,281 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Dana Johnson
    Dana Johnson
    10,337 Points

    What is wrong with my code for question 4 of 5 not working - Here is my code: first = re.match(r'Four', data)

    Posted on Jun 3, 2019 by Dana Johnson
    Dana Johnson
    10,337 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • BLESSING TASHINGA GURENJE
    BLESSING TASHINGA GURENJE
    5,793 Points

    can you assist please

    Posted on Nov 12, 2018 by BLESSING TASHINGA GURENJE
    BLESSING TASHINGA GURENJE
    5,793 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Jeremy Millar
    PLUS
    Jeremy Millar
    Courses Plus Student 3,375 Points

    why does this not work?

    Posted on Oct 11, 2018 by Jeremy Millar
    Jeremy Millar
    Courses Plus Student 3,375 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Karen Shumate
    Karen Shumate
    13,579 Points

    Use open() to load the file "basics.txt" into the variable file_object.

    Posted on Sep 15, 2018 by Karen Shumate
    Karen Shumate
    13,579 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • Rafay Ahmed
    Rafay Ahmed
    956 Points

    I have a syntax error

    Posted on Jul 15, 2018 by Rafay Ahmed
    Rafay Ahmed
    956 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Rafay Ahmed
    Rafay Ahmed
    956 Points

    Hi I have a syntax error as an indentation error

    Posted on Jul 15, 2018 by Rafay Ahmed
    Rafay Ahmed
    956 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Shorayi Spencer Guzha
    Shorayi Spencer Guzha
    6,044 Points

    Regular expressions Task 3 of 5 closing file_object my solution seem to be correct but not pasing

    Posted on Apr 2, 2018 by Shorayi Spencer Guzha
    Shorayi Spencer Guzha
    6,044 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Dominque Cox
    Dominque Cox
    15,362 Points

    What is wrong with my rile_object.close() line?

    Posted on Mar 30, 2018 by Dominque Cox
    Dominque Cox
    15,362 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    3 Answers

  • Avraham Shukron
    Avraham Shukron
    19,609 Points

    Closing a file in Python

    Posted on Mar 30, 2018 by Avraham Shukron
    Avraham Shukron
    19,609 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Warren Gates
    Warren Gates
    17,401 Points

    Now close the file_object file so it isn't taking up memory.

    Posted on Mar 30, 2018 by Warren Gates
    Warren Gates
    17,401 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    4 Answers

  • Cross Ender
    Cross Ender
    9,567 Points

    Here's another way to do it.

    Posted on May 28, 2017 by Cross Ender
    Cross Ender
    9,567 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • Hannah Trewern
    Hannah Trewern
    13,429 Points

    basics.py Task 4 of 5

    Posted on Mar 29, 2017 by Hannah Trewern
    Hannah Trewern
    13,429 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    3 Answers

  • Michael Blum
    Michael Blum
    254 Points

    Everytime I get to task 4 I get the same error : "It looks like Task 1 is no longer passing"... What should I do ?

    Posted on Mar 15, 2017 by Michael Blum
    Michael Blum
    254 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Kristine Saryan
    Kristine Saryan
    1,386 Points

    Why does it keep saying Task 1 is no longer passing when I try to do task 2. I haven't changed anything

    Posted on Mar 2, 2017 by Kristine Saryan
    Kristine Saryan
    1,386 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Russel Klueg
    Russel Klueg
    2,813 Points

    Python re.match() breaks Task 1

    Posted on Dec 28, 2015 by Russel Klueg
    Russel Klueg
    2,813 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • Amresh Venugopal
    Amresh Venugopal
    2,307 Points

    create a regex

    Posted on Sep 14, 2015 by Amresh Venugopal
    Amresh Venugopal
    2,307 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • Rungano Matonda
    Rungano Matonda
    3,237 Points

    Regular expressions in Python Task 5 of 5

    Posted on Apr 30, 2015 by Rungano Matonda
    Rungano Matonda
    3,237 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • sara oren
    sara oren
    1,798 Points

    Why isn't my answer going through?

    Posted on Mar 29, 2015 by sara oren
    sara oren
    1,798 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • Nyasha Chawanda
    Nyasha Chawanda
    7,946 Points

    using the re module

    Posted on Mar 4, 2015 by Nyasha Chawanda
    Nyasha Chawanda
    7,946 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    1 Answer

  • MUZ140330 Simbarashe Chibgwe
    MUZ140330 Simbarashe Chibgwe
    2,825 Points

    Import re. Create an re.match() for the word "Four" in the data variable. Assign this to a new variable named first.

    Posted on Feb 26, 2015 by MUZ140330 Simbarashe Chibgwe
    MUZ140330 Simbarashe Chibgwe
    2,825 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    2 Answers

  • Apus Wsoe
    Apus Wsoe
    7,555 Points

    Error`first` doesn't seem to be a regex match. Works in Preview first = r'Four' print(re.match(first, data))

    Posted on Jan 5, 2015 by Apus Wsoe
    Apus Wsoe
    7,555 Points
    • Python
    • Regular Expressions in Python
    • Introduction to Regular Expressions
    • The Basics

    4 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.