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 6783377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:51:23+00:00 2026-05-26T16:51:23+00:00

My regex is not working properly. I’m showing you before regex text and after

  • 0

My regex is not working properly. I’m showing you before regex text and after regex text. I’m using this regex re.search(r'(?ms).*?{{(Infobox film.*?)}}', text). You will see my regex not displaying the result after | country = Assam, {{IND . My regex stuck at this point. Will you please help me ? thanks

Before regex:

    
{{Infobox film
| name           = Papori
| released       = 1986
| runtime        = 144 minutes
| country        = Assam, {{IND}}
| language       = [[Assamese language|Assamese]]
| budget         = 
| followed by    = free
}}

After regex:

    
{Infobox film
| name           = Papori
| released       = 1986
| runtime        = 144 minutes
| country        = Assam, {{IND

Why regex stuck at this point? country = Assam, {{IND

Edit : Expecting Result

Infobox film
    | name           = Papori
    | released       = 1986
    | runtime        = 144 minutes
    | country        = Assam, {{IND}}
    | language       = [[Assamese language|Assamese]]
    | budget         = 
    | followed by    = free
  • 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-05-26T16:51:24+00:00Added an answer on May 26, 2026 at 4:51 pm

    Your regex is catching everything between the first {{ and the first }}, which is in the “country” entry of the infobox. If you want everything between the first {{ and the last }}, then you want to make the .* inside the braces greedy by removing the ?:

    re.search(r'(?ms).*?{{(Infobox film.*)}}', text)
    

    Note that this will find the last }} in the input (eg. if there’s another template far below the end of the infobox, it will find the end of that), so this may not be what you want. When you have nesting things like this, regex is not always the best way to search.

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

Sidebar

Related Questions

So why is this not working? I'm creating a regex that will match a
Possible Duplicate: My regex is not working properly Suppose I have long text. From
I can't seem to get my regex working properly. This works fine: RewriteRule ^profile/([0-9]+)/?$
I've read a few tutorials on jMeter RegEx extraction but it's not working. I'm
Please could someone explain to me why this regex does not match anything, when
I'm not a pro in Regex, therefore I'm having a difficulty translating this regex
Have the below perl grep regex and it's working properly. my @cont = grep
regex not working as wanted Code example: widgetCSS = #widgetpuffimg{width:100%;position:relative;display:block;background:url(/images/small-banner/Dog-Activity-BXP135285s.jpg) no-repeat 50% 0; height:220px;}
The following piece is not working properly: QRegExp exp ([À-Ÿà-ÿA-Za-z0-9\\-\\_]+); if (!formatedName.contains(exp)) { success
My simple date validation regex is not working correctly... validates_format_of :dob, :with => /\d{2}\/\d{2}\/\d{4}/,

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.