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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:36:19+00:00 2026-06-17T13:36:19+00:00

In the below xml i have to append all the url which comes under

  • 0

In the below xml i have to append all the url which comes under impression tag.

 <Ad id="32716">        
<InLine>            
    <AdSystem>BrightRoll</AdSystem>         
    <AdTitle/>          
    <Impression><![CDATA[http://2901.btrll.com/imp/2901/12446/PreRoll.911.123806/start;Video;1358769313]]>
    </Impression>           
    <Impression><![CDATA[http://brxserv.btrll.com/v1/epix/6835361/3850628/20799/32716/TbwKgCbwBkAABQ_SyhAABRPwAAf8wAOsGEAAAAAAAfYQiqTYrVDQ/event.imp/r_64.aHR0cDovL2Iuc2NvcmVjYXJkcmVzZWFyY2guY29tL3A_YzE9MSZjMj02MDAwMDA2JmMzPSZjND1icngmYzU9MDEwMDAwJmM2PTY4MzUzNjEmYzEwPSZjQTE9OCZjQTI9NjAwMDAwNiZjQTM9MjA3OTkmY0E0PTM4NTA2MjgmY0E1PTQ3NDcmY0E2PTY4MzUzNjEmY0ExMD0zMjcxNiZjdj0xLjcmY2o9JnJuPTEzNTg3NjkzMTMmcj1odHRwJTNBJTJGJTJGcGl4ZWwucXVhbnRzZXJ2ZS5jb20lMkZwaXhlbCUyRnAtY2I2QzB6RkY3ZFdqSS5naWYlM0ZsYWJlbHMlM0RwLjY4MzUzNjEuMzg1MDYyOC4wJTJDYS40NzQ3LjIwNzk5LjMyNzE2JTJDdS45NjguMHgwJTNCbWVkaWElM0RhZCUzQnIlM0QxMzU4NzY5MzEz]]>
    </Impression>           
    <Impression><![CDATA[http://ib.adnxs.com/seg?add=362896&t=2&cb=1358769313]]>
    </Impression>           
    <Impression><![CDATA[http://rc.rlcdn.com/361686.gif]]>
    </Impression>           
    <Impression><![CDATA[http://mobile.btrll.com/event/impression?ts=1358769313920&siteId=3850628&lineItemId=20799]]>
    </Impression>           
    <Creatives>             
        <Creative sequence="1">                 
            <Linear>                        
                <Duration>00:00:14</Duration>                       
                <TrackingEvents>                            
                    <Tracking event="midpoint"><![CDATA[http://brxserv.btrll.com/v1/epix/6835361/3850628/20799/32716/TbwKgCbwBkAABQ_SyhAABRPwAAf8wAOsGEAAAAAAAfYQiqTYrVDQ/event.mid/r_64.aHR0cDovLzI5MDEuYnRybGwuY29tL2ltcC8yOTAxLzEyNDQ2L1ByZVJvbGwuOTExLjEyMzgwNi9taWQ7VmlkZW87MTM1ODc2OTMxMw]]>
                    </Tracking>                         
                    <Tracking event="complete"><![CDATA[http://brxserv.btrll.com/v1/epix/6835361/3850628/20799/32716/TbwKgCbwBkAABQ_SyhAABRPwAAf8wAOsGEAAAAAAAfYQiqTYrVDQ/event.end/r_64.aHR0cDovLzI5MDEuYnRybGwuY29tL2ltcC8yOTAxLzEyNDQ2L1ByZVJvbGwuOTExLjEyMzgwNi9kb25lO1ZpZGVvOzEzNTg3NjkzMTM]]>
                    </Tracking>                         
                    <Tracking event="complete"><![CDATA[http://mobile.btrll.com/event/completion?ts=1358769313921&siteId=3850628&lineItemId=20799]]>
                    </Tracking>                     
                </TrackingEvents>                       
                <VideoClicks>                           
                    <ClickThrough><![CDATA[http://brxserv.btrll.com/v1/epix/6835361/3850628/20799/32716/TbwKgCbwBkAABQ_SyhAABRPwAAf8wAOsGEAAAAAAAfYQiqTYrVDQ/event.click/r_64.aHR0cDovLzI5MDEuYnRybGwuY29tL2Nsay8yOTAxLzEyNDQ2L1ByZVJvbGwuOTExLjEyMzgwNi9ub25lLztWaWRlbzsxMzU4NzY5MzEz]]>
                    </ClickThrough>                         
                    <ClickTracking><![CDATA[http://brxserv.btrll.com/v1/epix/6835361/3850628/20799/32716/TbwKgCbwBkAABQ_SyhAABRPwAAf8wAOsGEAAAAAAAfYQiqTYrVDQ/event.c_trk/r_64.aHR0cDovLzI5MDEuYnRybGwuY29tL2Nsay8yOTAxLzEyNDQ2L1ByZVJvbGwuOTExLjEyMzkyNy9ub25lLztWaWRlbzsxMzU4NzY5MzEz]]>
                    </ClickTracking>                            
                    <ClickTracking><![CDATA[http://mobile.btrll.com/event/click?ts=1358769313921&siteId=3850628&lineItemId=20799]]>
                    </ClickTracking>                        
                </VideoClicks>                      
                <MediaFiles>                            
                    <MediaFile delivery="progressive" type="video/mp4" bitrate="400" height="240" width="320"><![CDATA[http://brxcdn2.btrll.com/production/134980/Home_Depot_MuddyBoots_640x480_15sec.mp4]]>
                    </MediaFile>                        
                </MediaFiles>                   
            </Linear>                   
        </Creative>             
        <Creative sequence="1">                 
            <CompanionAds>                  </CompanionAds>             
        </Creative>         
    </Creatives>        
</InLine>   

In existing content between <Impression> and </Impression>, would like to add more string.

how can i achieve this?

i am trying something like this

$pattern = '<Impression>.*?</Impression>';      
preg_match($pattern, $jsaved, $matchesarr);
  • 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-17T13:36:20+00:00Added an answer on June 17, 2026 at 1:36 pm

    In most cases*, you should not use a regex for parsing HTML or XML. It is not the right tool for the job, and it is likely to be frustrating and error-prone. See this question for better ways of doing this in PHP.

    That being said, your regex is failing because, by default, . does not match a newline character. This means that you will only match <Impression>...</Impression> if it all occurs on a single line.

    To fix this, you have to add the multi-line switch (m):

    $pattern = '|<Impression>.*?</Impression>|m';

    **There are exceptions. A regex can be fine if your input is very well-defined and always follows a predictable format. But it is definitely worth considering whether an XML parser would be better.*

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

Sidebar

Related Questions

I have below XML which contains a default namespace <?xml version=1.0?> <catalog xmlns=http://www.edankert.com/examples/> <cd>
I have an xml as below < Image>ImageValue1 <Type>png</Type> <Value>ImageValue1</ Value> </ Image> Here
I have an xml string below that I've turned into an object using $content
I have an xml file likes below. <?xml version=1.0 encoding=utf-8 ?> <Book> <Title>Title</Title> <Content>Content</Content>
I have a xml that looks like below <xsl:template match=//xml> <xsl:for-each select=//z:row> <ul class
I have a xml file as below: <?xml version=1.0 encoding=UTF-8 standalone=no?> <RULES> <RULE DESCRIPTION=
i have an xml file sitemap.xml as shown below ..i need to add one
HI Can i have a xml defination like below <add key=FirstName ServerType=FirstName Mandatory=Yes length=3
I have an XML document containing contact information as seen below: <contact type=individual> <firstname>Some</firstname>
I have a standard code like below to validate xml against xsd, but it

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.