RegExp between tags

C

Charles Taylor

I have a regular expression problem that is driving me crazy.

How do you capture the stuff between two closed html tags i.e

<b>One</b>


Capture all this 'stuff'
<em>dkskldsd</em>
<table>
<tr><td></td></tr></table>

<b>Two</b>


this suprisingly doesnt work, it captures the <b> tags but not the 'stuff'

(?:<b>(?<bold>.*?)</b>)
(.|\s)*?

TIA
 
G

Guest

Hi,

I did not get the question. Can you clarify?

"(?:<b>(?<bold>.*?)</b>)(.|\s)*?" does capture "<b>Two</b>" as "bold = Two"

What do you mean by "all that stuff"? Your regexpression is made to only
capture the b tags.
 
N

Nergal

Hi,

By 'stuff' I mean anything that's between the ( closed ) bold tags.

This I was hoping to capture with (.|\s)*?

I'm attempting to capture the repeating pattern of bold tags followed by
other html.

Hope this clarifys it and thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top