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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:38:12+00:00 2026-05-17T06:38:12+00:00

I am trying to program a email piping php script that would take an

  • 0

I am trying to program a email piping php script that would take an incoming traffic update report via email, and extract the relevant information within it to store into a database.

The email usually starts with some introduction, with the important information displayed in the following format.

Highway : Some Highway 
Time : 08-Oct-2010 08:10 AM 
Condition : Smooth (or slow moving etc)

I tried with this code

preg_match_all('/(?P<\name>\w+) : (?P<\data>\w+)/i', $subject, $result);

Note the < / are really just < but somehow they are not being displayed here.

And the matches are only:

Highway : Some
Datetime : 08
Condition : Smooth

Can anybody tell me what’s missing in my second regex expression? Why doesn’t it include the entire string of words after the “:”?

  • 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-17T06:38:12+00:00Added an answer on May 17, 2026 at 6:38 am

    You are capturing \w+. That only matches word characters, this does not include spaces or parenthesis.

    Try

    preg_match_all('/(?P<name>\w+)\s*:\s*(?P<data>.*)/i', $subject, $result);
    

    try using .*? This will match everything up to the new line character

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

Sidebar

Related Questions

Im trying to setup a program that will accept an incoming email and then
I am trying to send an email via Outlook from within a VB6 program.
I'm trying to automate a program I made with a test suite via a
I'm trying to make a program in Visual C# that has my one created
I am trying to write a C++ program that takes the following inputs from
I am trying to build a notifier program(email alerts followed by sms alerts in
I am trying to send an email from a Ruby program. The smtp server
I'm trying to make a Python program that retrieves only the body text of
I'm trying to extract email addresses from plain text transcripts of emails. I've cobbled
I was trying to program a Timer class (unaware that boost had one), then

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.