471,347 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,347 software developers and data experts.

regex

hi!
can anyone help me with solving my problem?
i want to check my string if there's such substring in it:
<div class="some_class_i_want_to_set_this_value_before_ checking">
text_to_retrieve </div>

i would like to get in return text_to_retrieve. i know i have touse regular
expressions, a well known of working example for html tags is
@<(?<tag>\w*)>(?<text>.*)</\k<tag>> , but it will return only things like:
<p>ajajajaja</p>
how to solve my problem?
please help...

Jul 21 '05 #1
2 1084
> can anyone help me with solving my problem?
i want to check my string if there's such substring in it:
<div class="some_class_i_want_to_set_this_value_before_ checking">
text_to_retrieve </div>

i would like to get in return text_to_retrieve. i know i have touse regular
expressions, a well known of working example for html tags is
@<(?<tag>\w*)>(?<text>.*)</\k<tag>> , but it will return only things like:
<p>ajajajaja</p>
how to solve my problem?
please help...


Almost too easy to bother with. Try

<(?<tag>\w*)[^>]*>(?<text>.*)</(\k<tag>)>
--

www.midnightbeach.com
Jul 21 '05 #2
> can anyone help me with solving my problem?
i want to check my string if there's such substring in it:
<div class="some_class_i_want_to_set_this_value_before_ checking">
text_to_retrieve </div>

i would like to get in return text_to_retrieve. i know i have touse regular
expressions, a well known of working example for html tags is
@<(?<tag>\w*)>(?<text>.*)</\k<tag>> , but it will return only things like:
<p>ajajajaja</p>
how to solve my problem?
please help...


Almost too easy to bother with. Try

<(?<tag>\w*)[^>]*>(?<text>.*)</(\k<tag>)>
--

www.midnightbeach.com
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Tim Conner | last post: by
6 posts views Thread by Extremest | last post: by
7 posts views Thread by Extremest | last post: by
3 posts views Thread by aspineux | last post: by
15 posts views Thread by morleyc | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.