Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > RegExp between tags

Reply
Thread Tools

RegExp between tags

 
 
Charles Taylor
Guest
Posts: n/a
 
      04-08-2005
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RXRoZW0gQXp1bg==?=
Guest
Posts: n/a
 
      04-08-2005

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.





"Charles Taylor" wrote:

> 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
>

 
Reply With Quote
 
 
 
 
Nergal
Guest
Posts: n/a
 
      04-08-2005
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.

"=?Utf-8?B?RXRoZW0gQXp1bg==?=" <(E-Mail Removed)>
wrote in news:(E-Mail Removed):

>
> 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.
>
>
>
>
>
> "Charles Taylor" wrote:
>
>> 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
>>




--
¬¬¬¬nergal¬¬¬¬
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[regexp] How to convert string "/regexp/i" to /regexp/i - ? Joao Silva Ruby 16 08-21-2009 05:52 PM
Tabbing between text inputs with other tags between them Thierry Lam HTML 7 05-02-2009 12:21 PM
Regexp - global replace of a character between tags MB Javascript 3 03-29-2007 04:04 PM
Programmatically turning a Regexp into an anchored Regexp Greg Hurrell Ruby 4 02-14-2007 06:56 PM
replacing tags between tags beartiger@gmail.com Perl Misc 9 09-19-2005 02:32 AM



Advertisments