Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8354717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:38:18+00:00 2026-06-09T09:38:18+00:00

I am starting learning Python and i have problem with regex and python. I

  • 0

I am starting learning Python and i have problem with regex and python.

I want to check if word prefix is “aa” and suffix”bb”. But i can only check prefix. Could you write some simple regexp for checking prefix and suffix is satisfied.

bool(re.match(regexp, word))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:38:19+00:00Added an answer on June 9, 2026 at 9:38 am

    You can do it without regex:

    word.startswith("aa") and word.endswith("bb")
    

    or with regex:

    bool(re.match("^aa.+bb$", word))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

just considering starting to learning python but I have one concern before I invest
This seems to match the rules I have defined, but I only starting learning
I have been learning python for some time now. While starting this learning python
I'm starting learning JAXB, so my question can be very silly. Now I have
I'm just starting out learning python (for webapp usage) but I'm confused as to
So, I starting to learning Tkinter in Python, (just starting to learn Python, for
I'm interested in learning some python, and thought Pylons would be a good starting
I'm only starting learning c# (and programming in general). I'm doing a little college
Can you refer me to a good starting place for learning GAE from what
I'm just starting out learning python with GEdit plus various plugins as my IDE.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.