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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:28:32+00:00 2026-06-16T19:28:32+00:00

I have this string: EXAMPLE|abcd|[!PAGE|title] I want to split it like this: Array (

  • 0

I have this string:

EXAMPLE|abcd|[!PAGE|title]

I want to split it like this:

Array
(
    [0] => EXAMPLE
    [1] => abcd
    [2] => [!PAGE|title]
)

How to do it?
Thank you.

  • 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-16T19:28:34+00:00Added an answer on June 16, 2026 at 7:28 pm

    DEMO

    If you don’t need anything more than you said, is like parsing a CSV but with | as separator and [ as " so: (\[.*?\]+|[^\|]+)(?=\||$) will do the work I think.

    EDIT: Changed the regex, now it accepts strings like [asdf]].[]asf]

    Explanation:

    1. (\[.*?\]+|[^\|]+) -> This one is divided in 2 parts: (will match 1.1 or 1.2)
      1.1 \[.*?\]+ -> Match everything between [ and ]
      1.2 [^\|]+ -> Will match everything that is enclosed by |
    2. (?=\||$) -> This will tell the regular expression that next to that must be a | or the end of the string so that will tell the regex to accept strings like the earlier example.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, I have this string that could change anytime I only want the
For example I have this string of 2 json objects: {"glossary": {"title": "example glossary"},
Say I have this example string <td><a href=/one-two-three/menus title=test</td> <td><a href=/one-two-three/menus/13:00 title=test</td> <td><a href=/one-two-three/schedule/could
for example we have this string: hello_my name_is_bob and want to get only the
So I have this string: (a url) example.html/#playYouTubeVideo=id[lBs8jPDPveg]&width[160]&height[90] I want to match id, width
Basically I have this string for example $str = 'По, своей 12' I need
I have for example this string: iCanSeeBluePeople and I need it to separate it
I have a string as const char *str = Hello, this is an example
For example, I have a string variable named str. This str has a value
i have a string like this one $sitesinfo = 'site 1 titles-example1.com/ site 2

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.