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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:15:28+00:00 2026-05-16T12:15:28+00:00

Im quite new to stackoverflow so I dont know if this question has been

  • 0

Im quite new to stackoverflow so I dont know if this question has been asked before, but I cant seem to find any past questions which hint at the answer. Any help is really appreciated and thanks in advance.

I have this text:

{
   1282837200, -- [1]
   "Type", -- [2]
   "Name", -- [3]
   "Reason", -- [4]
   Amount, -- [5]
  }, -- [1]
  {
   1282838220, -- [1]
   "Type", -- [2]
   "Name", -- [3]
   "Reason", -- [4]
   Amount, -- [5]
  }, -- [2]

Which I need to create a regular expression for and extract the necessary data. I understand how to extract data from source files using regular expressions within PHP, using source text which has no “whitespace” or carriage returns.

But I need help with creating an expression which includes the whitespace etc. included within this source.

  • 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. Editorial Team
    Editorial Team
    2026-05-16T12:15:28+00:00Added an answer on May 16, 2026 at 12:15 pm

    \s is the symbol for whitespace, which may or may not include newlines, anyway there’s [\r\n] for them, ignore these and that’s it. You could also tell what exactly you want to do or even post the regex you have so far so I can help you further if you want.

    EDIT: I’m just guessing, the regexp you want may be this:

    /\s*{[\s\n\r]*^\s*(\d+).*[\s\n\r]*^\s*"([^"]+)".*[\s\n\r]*^\s*"([^"]+)".*[\s\n\r]*^\s*"([^"]+)".*[\s\n\r]*^\s*(\w+).*[\s\n\r]*^\s*},.*[\s\n\r]*^/m
    

    This matches one block and disregards the numbers in brackers. /m switch triggers multiline mode.

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

Sidebar

Related Questions

I know this question has been asked quite often, but this seems to be
New to stackoverflow, been very helpful searching, but alas the time has come to
This is my first question here on StackOverflow, and quite frankly I'm fairly new
I'm quite new to stackoverflow and this is my first question. I am trying
I'm quite new to CSS / HTML, and can't find the cause of this
I'm not quite sure stackoverflow is a place for such a general question, but
I know this is quite a vague question -- sorry about that. If I
I'm new to ruby and this is my first stackoverflow question (although I've used
Scenario: Quite new to DI and Ninject but would love to master it so
I'm quite new in PHP dev and I can't find a way to solve

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.