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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:04:38+00:00 2026-05-19T22:04:38+00:00

In direct follow-up to this previous question , how can I pull the text

  • 0

In direct follow-up to this previous question, how can I pull the text (and the braces if possible) out as a match using PHP?

Specifically, I am writing a WordPress plugin and am looking to reformat all text between two curly braces (a quasi wiki-marking).

I’ve followed the steps outlined in another previous question I asked, and have the matching part working – it’s the match I need help with.

Example:

This is some {{text}} and I want to reformat the items inside the curly braces

Desired output:

This is some *Text fancified* and I want to reformat the items inside the curly braces

What I have (that is not working):

$content = preg_replace('#\b\{\{`.+`\}\}\b#', "<strong>$0</strong>", $content);

If matching including the braces is too difficult, I can match using the braces as offsets, and then remove the ‘offending’ braces afterwards, too, using a more simple text-match function.

  • 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-19T22:04:38+00:00Added an answer on May 19, 2026 at 10:04 pm
    $content = preg_replace('/{([^{}]*)}/', "<strong>$1</strong>", $content);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very direct question, i need to know if its possible and maybe where to
I am trying to follow this example but I can't understand this part: Imagine
Could not find a direct answer to this anywhere. Can someone shed some lights.
Possible Duplicate: Direct casting vs 'as' operator? Casting vs. using the as keyword in
This is a follow-up to this question . I'm currently writing a simple game
I can find a direct table foreign key in c# like: foreach (ForeignKey key
Can anyone direct me to a smallish C# application that would be symbolic of
This is a pure physic question but i don't know why it doesn't work....i
Possible Duplicates: Direct casting vs 'as' operator? Casting: (NewType) vs. Object as NewType What
I'm drawing some splines using GeneralPath as follow: GeneralPath path = new GeneralPath(); path.moveTo(x0,

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.