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

  • SEARCH
  • Home
  • 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 8009291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:24:10+00:00 2026-06-04T18:24:10+00:00

I try to learn python3 and i am stack little bit with the regular

  • 0

I try to learn python3 and i am stack little bit with the regular expressions. I study the HOWTO for this but i did not understand very well.this page

    1\d2\D2
    ^a\w+z$
  • 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-04T18:24:12+00:00Added an answer on June 4, 2026 at 6:24 pm

    you can generate example strings by reading the expression and choosing appropriate characters step by step.

    for example, 1\d2\D2:

    1\d2\D2 -> 1
    ^ 1 means a literal number 1
    
    1\d2\D2 -> 17
     ^^ \d means any digit (0-9).  let's choose 7.
    
    1\d2\D2 -> 172
       ^ 2 means a literal number 2.
    
    1\d2\D2 -> 172X
        ^^ \D means anything *but* a digit (0-9).  let's choose X
    
    1\d2\D2 -> 172X2
          ^ 2 means a literal number 2.
    

    so 172X2 would be matched by 1\d2\D2

    your next one – ^a\w+z$ – can have multiple lengths:

    ^a\w+z$
    ^ this means we need to be at the start of a line (and we are, so that's cool)
    
    ^a\w+z$ -> a
     ^ a means a literal letter a
    
    ^a\w+z$ -> a4
      ^^ \w means a digit, letter, or "_".  let's choose 4.
    
    ^a\w+z$ -> a4
        ^ + means we can return to whatever is to the left, if we want, so let's do that...
    
    ^a\w+z$ -> a4Q
      ^^ \w means a digit, letter, or "_".  let's choose Q.
    
    ^a\w+z$ -> a4Q
        ^ + means we can return to whatever is to the left, if we want, so let's do that...
    
    ^a\w+z$ -> a4Q1
      ^^ \w means a digit, letter, or "_".  let's choose 1.
    
    ^a\w+z$ -> a4Q1
        ^ + means we can return to whatever is to the left, but now let's stop
    
    ^a\w+z$ -> a4Q1z
         ^ z means a literal letter z
    
    ^a\w+z$ -> a4Q1z
          ^ $ means we must be at the end of the line, and we are (and so cannot add more)
    

    so a4Q1z would be matched by ^a\w+z$. so would a4z (you can check…)

    note that * is like + in that you can jump back and repeat but also it means that you can completely skip what is to the left (in other words, + means “repeat at least once”, but * means “repeat zero or more” (the “zero” being the skip)).

    update:

    [abc] means pick any one of a, b or c.

    x{2,3} means add x 2 to 3 times (like + but with limits to the number of times). so, xx or xxx.

    \1 is a bit more complicated. you need to find what would have been inside the first (because the number 1) set of parentheses and add that. so, for example, (\d+)\1 would match 2323 if you had worked from left to right and chosen 23 for (\d+).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to learn Rspec , but I don't understand what is that. Let
I am working with this example to try and learn Sencha Touch. I have
I try: C:\Users\me\Documents\worknotes\performance\tomcatlogs\livesite\learn>sed -e 's/"//g' local07.csv > local07nq.csv But instead of outputting to the
I'm trying to learn MVC3 razor but I'm hitting a snag whenever I try
I've started a little side project to try to learn a few new concepts
I try to learn writing parallel codes with thread library of c++11 so first
Bear with me as I try to learn more about .htaccess redirect rules -
I am coming from Java and try to learn Javascript right now. Doing that
I am doing the below test to try and learn more about LINQ to
I'm learned php as functional and procedure language. Right now try to start learn

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.