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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:13:05+00:00 2026-05-23T15:13:05+00:00

My Code preg_match_all(‘/\{([\w]+)(\s.*)?[^\}]\}(.*)\{\/\w+[^\}]\}/’, $nbody, $matches ); My Template rtrim: Beginning Text{rtrim} String {/rtrim}Surrounding Text

  • 0

My Code

preg_match_all('/\{([\w]+)(\s.*)?[^\}]\}(.*)\{\/\w+[^\}]\}/', $nbody, $matches );

My Template

rtrim: Beginning Text{rtrim}  String     {/rtrim}Surrounding Text
camelize: {camelize}Camelize Some Text Like A MediaWiki Title{/camelize}

Date Modifiers
date: {date format="M/d/Y"}June 14th 1965{/date}
iso date: {date format="c"}1310036802{/date}
timestamp date: {date format="c"}June 14th 1965{/date}
time: {time}{/time}

I am trying to get my regex to work so that I can capture the attributes as seen with the {date format=””} example. With the above pattern I’m 99% of the way there but it eats the last character of {tags} without attributes.

...
[11] => rtri
[12] => cameliz
[13] => date
[14] => date
...

As well as the last ” of the attribute matches

...
[13] =>  format="M/d/Y
[14] =>  format="c
[15] =>  format="c
...

Any help would be appreciated!

  • 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-23T15:13:05+00:00Added an answer on May 23, 2026 at 3:13 pm

    this expr would probably fit better

    ~{(\w+)(.*?)}(.*?){/\\1}~si
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code: $row['text'] = 'http://t.co/iBSiZZD4 and http://t.co/1rG3oNmc and http://t.co/HGFjwqHI and http://t.co/8UldEAVt'; if(preg_match_all('|http:\/\/t.co\/.{1,8}|i',$row['text'],$matches)){ foreach($matches[0] as
Code (preg_match_all(#\[level-(.+)-\](.+?)\[/level\]#, $string, $matches) Problem if I assign any value to $string with enter,
Here's my regex code: preg_match_all('/background[-image]*:[\s]*url\([|\']+(.*)[|\']+\)/', $css, $matches, PREG_SET_ORDER); It looks for CSS that looks
preg_match(/\b(word1|word2)\b/iu, 'text text text word1 text text'); For some reason the above code doesn't
preg_match_all('/<p>.*:</p>/gm', $content, $matches); var_dump($matches); //ouput is NULL I want something like this: <p>The Ideal
This is the not working code: <?php $matchWith = http://videosite.com/ID123 ; preg_match_all('/\S\/videosite\.com\/(\w+)\S/i', $matchWith, $matches);
<? function recursiveSplit($string, $layer) { $err = preg_match_all("/\{(([^{}]*|(?R))*)\}/",$string,$matches); echo "Elementi trovati: $err<br>"; if($err ==
Here's my code: $post = $_POST['test']; $pattren='/((([http]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\/+=&#?;%@,.\w_]*)#?(?:[\w]*)?))/'; preg_match_all( $pattren, $post, $matches); foreach($matches[0] as $match)
$pattern = '#\[img (([^=\]]+)=([^]+) ?)+\]#'; preg_match_all($pattern,$blog,$matches,PREG_PATTERN_ORDER); [img size=preview click=http://text.com align=right src=pic:3378f.jpg] The code at
I have this little code to capture text between brackets: $string = '[title=my title]

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.