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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:39:23+00:00 2026-05-30T18:39:23+00:00

I’m trying to find some very specific data in a string. The problem is

  • 0

I’m trying to find some very specific data in a string. The problem is I’m not finding all of the data with the current regex I’m using. Here is some sample data:

[img:2gcfa9cc]http://img823.imageshack.us/img823/3295/pokaijumonlogo.jpg[/img:2gcfa9cc]

Making these little guys into Kaiju monsters.  Again, I know nothing about them, other then which ones I thought would make for cool possible Kaiju (of the original 150) so here's Day 01

[b:2gcfa9cc][size=150:2gcfa9cc]BULBASAUR[/size:2gcfa9cc][/b:2gcfa9cc]
[i:2gcfa9cc]Feb 01[/i:2gcfa9cc]
[ddf2k12:2gcfa9cc]http://img853.imageshack.us/img853/2185/dailydrawfeb2012day01.jpg[/ddf2k12:2gcfa9cc]

Setting myself up with the same "parameters" as last year

I may be breaking my own Challenge rules right now but...well I started this last night and I couldn't just leave 'em out in the cold all unfinished 'n' shit.  

Obligatory Skyrim drawing.

[ddf2k12:2ytorpmj]http://4.bp.blogspot.com/-UIUSNXvnHz4/TynYf1BZ9oI/AAAAAAAAAl4/pRLHVP0Ny3U/s1600/01_cheatingcheaterwarmup1.jpg[/ddf2k12:2ytorpmj]

What I’m trying to get is the data between the ddf2k12 tags and the img tags. I’ve only worked on the ddf2k12 tags thus far (I figure the latter will be the former with img instead of ddf2k12) and out of the 1586 tags I should have found, I’m only getting 5. Here’s my regex:

ddf2k12_regex = '(\[[ddf2k12]+\:[A-Za-z0-9]+\])(.*?)(\[[ddf2k12]+\:[A-Za-z0-9]+\])'
ddf2k12_find = re.findall(ddf2k12_regex, post)

Obviously there’s something wrong with my regex, but after banging my head against a wall I can’t sort it out, so any help is appreciated. Thanks.

  • 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-30T18:39:25+00:00Added an answer on May 30, 2026 at 6:39 pm

    You will do yourself a big favor by breaking down that big regex into parts and use composition. This seems to work correctly, and it’s more obvious how to debug it.

    import re
    
    start_tag =    '(\[{tagname}:[^\]]+\])'
    end_tag = start_tag.replace('\[', '\[\/', 1)
    content = '((?:.|\n)*?)' # The ?: indicates a non-capturing group.                                                                                             
    tag = start_tag + content + end_tag
    
    ddf_tag=tag.format(tagname='ddf2k12')
    
    for match in re.findall(ddf_tag, post):
        print match
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.