Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16747
    jic
    Participant

    Greetings.

    I have the following string…
    <p class=”key”>Tüm</p><br />

    • blah.

    <p class=”key”>blah.</cf><br indentlevel=”1″ indentation=”0″ leftmargin=”0″ alignment=”l” spacebefore=”4.32″ deftabsize=”1″/></p><br/>

    • <cf lang=”en-US” font=”Calibri” csfont=”+mn-cs” eafont=”+mn-ea” size=”13″ color=”windowText”>blah blah blah.</cf><br indentlevel=”1″ indentation=”-0.26″ leftmargin=”0.26″ bullettype=”ppBulletUnNumbered” character=”•” font=”Arial” color=”windowText” alignment=”l” spacebefore=”3.12″ deftabsize=”1″ endsize=”13″/>
    • <br />

    • blah blah blah….

      if I do a search for,

      <br in.*>

      it should just grab the tag <br indentlevel…> correct? Well, it is grabbing everything all the way to the end of line and leave the last tag there. Any thoughts on this one? Thanks.

    #16748
    jic
    Participant

    Sorry, repost…

    `<p class=”key”>Tüm</p><br />

    • blah.

    <p class=”key”>blah.</cf><br indentlevel=”1″ indentation=”0″ leftmargin=”0″ alignment=”l” spacebefore=”4.32″ deftabsize=”1″/></p><br/>

    • <cf lang=”en-US” font=”Calibri” csfont=”+mn-cs” eafont=”+mn-ea” size=”13″ color=”windowText”>blah blah blah.</cf><br indentlevel=”1″ indentation=”-0.26″ leftmargin=”0.26″ bullettype=”ppBulletUnNumbered” character=”•” font=”Arial” color=”windowText” alignment=”l” spacebefore=”3.12″ deftabsize=”1″ endsize=”13″/>
    • <br />

    • blah blah blah….
    #16749
    jic
    Participant

    I guess the code part did not work, but there is a piece of the string that shows the desired capture. Thanks.

    #16956
    Stefan
    Participant

    if I do a search for,

    <br in.*>

    it should just grab the tag <br indentlevel…> correct?
    Well, it is grabbing everything all the way to the end of line and leave the last tag there.
    Any thoughts on this one? Thanks.

    Please note that regex multiplier like plus and star works greedy in mostly every regex engine, so here too.

    Use the non-greedy , frugal switch ‘?‘ to get what you are after:

    <br in.*?>

    .

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.