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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:40:53+00:00 2026-05-25T19:40:53+00:00

I have a simple regex: \[quote\](.*?)\[\/quote\] Which will replace [quote] by table, tr and

  • 0

I have a simple regex:

\[quote\](.*?)\[\/quote\]

Which will replace [quote] by table, tr and td. (and [/quote] by /td, /tr and /table)

It works perfectly for multiple separate quotes in the same string:

IE:

[quote]
Person 1
[/quote]
Person 3 talking about a quote

[quote]
Person 2
[/quote]
Person 3 talking about another quote.

But when it tries to replace multiple (non-separate) quote in the same string:

IE:

[quote]
[quote]
Person 1
[/quote]
Person 2 quoting person 1
[/quote]
Person 3 quoting person 2 and 1

It messes up, (matches the first quote to the first /quote when it should be matching second quote to first /quote and first quote to last /quote)

How would I edit the regex so it works in both examples?

  • 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-25T19:40:54+00:00Added an answer on May 25, 2026 at 7:40 pm

    Regex isn’t a good choice for parsing nested structured text. See this question for JavaScript BBCode parser

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

Sidebar

Related Questions

Simple regex question. I have a string on the following format: this is a
I have a rather simple C++ project, which uses boost::regex library. The output I'm
I have simple regex for parsing this string: rawresp0 = <response> <comment>Привет.</comment> </response> I
I have simple regex \.*\ for me its says select everything between and ,
I have this simple regex, [\d]{1,5} that matches any integer between 0 and 99999.
Let's say I have two strings like this: XABY XBAY A simple regex that
I've been looking for a simple regex for URLs, does anybody have one handy
I have a simple question how do I remove a \ with regex? Thanks
I have a very simple CLR Function for doing Regex Matching public static SqlBoolean
I have this huge RegEx for matching credit cards numbers. But its PCRE. Works

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.