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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:19:02+00:00 2026-06-05T12:19:02+00:00

I am trying to fetch this from a file: BEGIN_SEREFERRALS 2 google 13 15

  • 0

I am trying to fetch this from a file:

BEGIN_SEREFERRALS 2 google 13 15 search 2 2 END_SEREFERRALS

I use this function:

     function getTextBetweenSEO($file)
{
    $pattern = "/BEGIN_SEREFERRALS\s(.*)\sEND_SEREFERRALS/i";
    preg_match_all($pattern, $file, $matches);
    print_r($matches);
    exit();
    return $matches[1];

}

What I have printed is this:

Array ( [0] => Array ( ) [1] => Array ( ) )

why does the regular expression fails

  • 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-05T12:19:04+00:00Added an answer on June 5, 2026 at 12:19 pm

    you can try with this regex :

    $pattern = “^BEGIN_SEREFERRALS(.*)END_SEREFERRALS^”;

    Array
    (
        [0] => Array
            (
                [0] => BEGIN_SEREFERRALS 2 google 13 15 search 2 2 END_SEREFERRALS
            )
    
        [1] => Array
            (
                [0] =>  2 google 13 15 search 2 2 
            )
    )
    

    FIX For pattern on blob text data:

    $pattern = “/BEGIN_SEREFERRALS(.*)END_SEREFERRALS/”;

    getTextBetweenSEO("jsdfhksdjhskjfdsjfhsdkjfhBEGIN_SEREFERRALS 2 google 13 15 search 2 2 END_SEREFERRALSjklajdakldjaslkdjakldjalkdjalksdj")
    
    Array
    (
        [0] => Array
            (
                [0] => BEGIN_SEREFERRALS 2 google 13 15 search 2 2 END_SEREFERRALS
            )
    
        [1] => Array
            (
                [0] =>  2 google 13 15 search 2 2 
            )
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to fetch some records from table but when i use OR
Using httplib2 and urllib2, I'm trying to fetch pages from this url, but all
I am trying to fetch data from the text file. The lines of interest
I'm trying to fetch some data from a column whose DATA_TYPE=NUMBER(1,0) with this piece
I am trying to fetch a JSON file from my website and parse it.
Using Google App Engine, I am trying to urlfetch a gzip file from a
I've spent hours trying to make this work. No solutions from the search have
I'm trying to fetch and parse an XML-file through JavaScript. I don't control the
I'm trying to fetch some settings from my membership provider in my asp.net application
I'm trying to fetch data from a div (based on his id), using PHP's

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.