- AuthorPosts
- September 21, 2013 at 12:57 pm #16747jicParticipant
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″/>
- 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.
<br />
September 21, 2013 at 12:58 pm #16748jicParticipantSorry, 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″/>
- blah blah blah….
<br />
September 21, 2013 at 12:59 pm #16749jicParticipantI guess the code part did not work, but there is a piece of the string that shows the desired capture. Thanks.
October 1, 2013 at 6:09 am #16956StefanParticipantif 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.*?>
.
- AuthorPosts
- You must be logged in to reply to this topic.