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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:00:35+00:00 2026-06-14T18:00:35+00:00

A system message may include the following status sentence: This function was executed 312

  • 0

A system message may include the following status sentence:

This function was executed 312 times, most often used by process Urbanus: 16.06.2012 14:10.

The sentence always is in one line.

I need to:

  1. Retrieve the three bold parts:
    • An integer between 1 and n (here: 312)
    • A string consisting of characters, symbols (incl. whitespaces but excl. newline) and numbers (here: Urbanus)
    • A date which is either “Today” or “Yesterday” or a date in DD.MM.YYYY (here: 16.06.2012)
    • A time in 24hrs hh:mm format (here: 14:10)
  2. Remove the whole sentence from the system message.

I tried the following, but it’s not working:

$matches = preg_replace(
"/This function was executed ([1-9]|[1-9][0-9]|[1-9][0-9][0-9]) times, most often used by process (.+?): ((Today|Yesterday|[0-9]{2}.[0-9]{2}.[0-9]{4}) ([0-9]{2}:[0-9]{2}))./iU", 
"", 
$message);
  • 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-06-14T18:00:36+00:00Added an answer on June 14, 2026 at 6:00 pm

    1part:

    Try use preg_match_all. Also I improve your pattern

    $message = 'This function was executed 312 times, most often used by process Urbanus: 16.06.2012 14:10.';
    
    $matches = array();
    if (preg_match_all("/This function was executed ([1-9]|[1-9][0-9]+) times, most often used by process (\w+?): ((Today|Yesterday|[0-9]{2}.[0-9]{2}.[0-9]{4}) ([0-9]{2}:[0-9]{2}))./i", $message, $matches)) {
        var_dump($matches);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

what this exception: System.MissingMethodException was unhandled Message: File or assembly name 'System.Windows.Forms, Version=3.5.0.0, Culture=neutral,
I have this error message could not load assembly 'system.data.entity, version 4.2.0.0, culture=neutral,publickeytoken=b77a5c561934e089' or
I am creating a private message system to allow users to communicate between one
Question We're developing a custom EventEmitter inspired message system in Objective-C. For listeners to
So I am writing a simple inbox private message system. My table schema is
I have different Bundles: MainBundle (Homepage), SecurityBundle (Login, Registration), MessageBundle (Message System), ShopBundle. I
I am coding a message distribution system. Server is ColdFusion (CF) 10, using the
Objective-C uses a sophisticated message-passing system when one object calls a method on another
Once the system is shutdown there will be message in syslog file. I have
I have a messaging system (very basic) that has a table like this: **MESSAGE_ID**

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.