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

The Archive Base Latest Questions

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

I have never understood the pattern of regular expression and after googling I haven’t

  • 0

I have never understood the pattern of regular expression and after googling I haven’t been any wiser.

I want to grab the WordPress version number (3.2) from this string:

<meta name="generator" content="WordPress 3.2" />

In the future when upgrading to 3.3 I wan’t the split code to be able to get that to. So no static expression.

How do I solve this?

  • 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-23T16:39:48+00:00Added an answer on May 23, 2026 at 4:39 pm

    Here is a regular expression that works for this…

    $str = '<meta name="generator" content="WordPress 3.2" />';
    preg_match('/meta name="generator" content="WordPress [0-9]+\.[0-9]" /', $str, $matches);
    preg_match('/[0-9]+\.[0-9]/', $matches[0], $matches1);
    $version = $matches1[0];
    echo "Wordpress version is = $version";
    

    It should output this:

    WordPress version is = 3.2

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

Sidebar

Related Questions

I've been programming in Perl for a while, but I never have understood a
I've been using Objective-C for a while now, but have never really understood what
I have never done any Windows coding and I would like to give it
I have never understood what is the ideal way to name a project, package,
This answer hit a nerve with me on something I have never understood with
I have never understood semaphores well enough. Every time, I venture to understand them,
I have often heard this term being used, but I have never really understood
I am currently taking a software design course. I myself have never been really
There is something I have never understood. How can a great big PC game
I have come across this problem before and I have never understood the reasoning

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.