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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:45:59+00:00 2026-05-14T08:45:59+00:00

i need help with creating a regex for putting all values into an array!

  • 0

i need help with creating a regex for putting all values into an array!

assuming we have a huge file full of theese:

Classic iCalendar style:

so we know that each segment start with BEGIN:VEVENT and end with END:VEVENT

...
END:VEVENT 

BEGIN:VEVENT
UID:e3cafdf3-c5c7-427e-b8c3-653015e9321a
SUMMARY:Some Text Here
DESCRIPTION:Some Text Here\n555-555-555
ORGANIZER;CN=Some/Text/Here
DTSTART;TZID="Some/Text/Here":20100802T190000
DTEND;TZID="Some/Text/Here":20100802T193000
STATUS:CONFIRMED
CLASS:PUBLIC
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
TRANSP:OPAQUE
X-MICROSOFT-DISALLOW-COUNTER:TRUE
DTSTAMP:20100423T021222Z
SEQUENCE:1
END:VEVENT 

BEGIN:VEVENT
...

by using preg_match_all that i think is the best choice for doing this, what’s the regex that can hold all theese values into array!?

PS: between segments there are no line break this is just for example!

EDITED:
just for clarification i want achieve a result like this:

        Array
        (
            [0] => Array
                (
                [0] => '
UID:e3cafdf3-c5c7-427e-b8c3-653015e9321a
SUMMARY:Some Text Here
DESCRIPTION:Some Text Here\n555-555-555
ORGANIZER;CN=Some/Text/Here
DTSTART;TZID="Some/Text/Here":20100802T190000
DTEND;TZID="Some/Text/Here":20100802T193000
STATUS:CONFIRMED
CLASS:PUBLIC
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
TRANSP:OPAQUE
X-MICROSOFT-DISALLOW-COUNTER:TRUE
DTSTAMP:20100423T021222Z
SEQUENCE:1
                   '
                )

            [1] => Array
                (

...
                )
    ...

        )

thank’s to All for the time!

Regards
Luca Filosfi

  • 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-14T08:45:59+00:00Added an answer on May 14, 2026 at 8:45 am

    Why use regular expressions?

    This sounds like a job for explode() and a little bit of cleanup.

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

Sidebar

Related Questions

i need help in creating skip rules i have array of 15rows,need to skip
I need a little help creating a catch-all error handling page in my ICEfaces
i need some help with creating file Im trying in the last hours to
need a small basic help, I am creating a XML file on the fly
I need help creating a self extracting zip file that does not display anything.
I need some help creating the necessary Javascript to add values to an existing
I need help creating the regex for a password. The password can contain letters,
I need help creating the best possible regular expression for this problem. I have
I need help creating an efficient JS listener against an array of objects and
I need help in creating a xml file from my php code. I created

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.