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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:31:11+00:00 2026-05-11T01:31:11+00:00

I have a CMS with a WYSIWYG editor which produces pretty good xhtml. Based

  • 0

I have a CMS with a WYSIWYG editor which produces pretty good xhtml. Based on this fact, I think a HTML parser might be slightly overkill for this small job.

I am intending to use regular expressions but so far have been unable to get mine to match what I’m after.

I’m using PHP5.

I need to match the content of the 3 block level elements the WYSIWYG editor is able to produce: p, ul & ol. I am using preg_match_all() currently.

Is anyone able to help me?

Thank you

  • 1 1 Answer
  • 2 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. 2026-05-11T01:31:12+00:00Added an answer on May 11, 2026 at 1:31 am

    This should work as long as you don’t have nested p/ul/ol tags:

    preg_match_all('<(?:p|ul|ol)>(.*?)</(?:p|ul|ol)>', $string, $matches) 

    ?: prevents anything in the parens from being included in $matches and .*? prevents the regex from matching past the end of another tag.

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

Sidebar

Related Questions

We have a CMS which has several thousand text/html files in it. It turns
I am integrating WYSIWYG editor for a fairly simple CMS. I have chosen CKeditor
I have a CMS that uses a syntax based on HTML comments to let
In my CMS application, administration users can add HTML content via a WYSIWYG editor
I have to use tinymce as a wysiwyg editor in a CMS to populate
This is a bit of a specific request unfortunately. I have a CMS that
I am writing a plugin to an old IE-only WYSIWYG-editor which resides in an
We have a CMS plugin that writes statistics to 1 table, this creates performance
I have a cms page in magento which I would like to display all
I have a CMS system which has a sitemap table with a parent-child relationship

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.