Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Regular Expresssions
#2
<div>Hi,</div>
<div> </div>
<div>Assuming I'm reading this correctly, you want to strip the tags surrounding the <img> tag, right?  If that's the case, then you really only need to capture the <img> tag.</div>
<div> </div>
<div>This particular regular expression may do what you want...note that this uses a quick and dirty method of picking up html tags, and would fail if there were another ">" character inside the tag.</div>
<div>
<pre class="_prettyXprint">
<p[^>]*>(<img[^>]+\/>)<\/p></pre>
If this doesn't quite work for you, then you may want to try experimenting with http://regexpal.com/ ...I've found the highlighting to be quite helpful.

 

</div>
<div>Hopefully that helped. Smile</div>
Reply


Messages In This Thread
[SOLVED] Regular Expresssions - SK+ - 11-30-2013, 12:24 PM
[SOLVED] Regular Expresssions - lightbender - 11-30-2013, 05:30 PM
[SOLVED] Regular Expresssions - SK+ - 11-30-2013, 09:01 PM
[SOLVED] Regular Expresssions - JoWie - 11-30-2013, 09:54 PM
[SOLVED] Regular Expresssions - Bargeld - 12-01-2013, 11:43 PM
[SOLVED] Regular Expresssions - JoWie - 12-02-2013, 11:43 AM
[SOLVED] Regular Expresssions - SK+ - 12-03-2013, 04:59 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)