473,388 Members | 970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 1141
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tim Conner | last post by:
Is there a way to write a faster function ? public static bool IsNumber( char Value ) { if (Regex.IsMatch( Value.ToString(), @"^+$" )) { return true; } else return false; }
6
by: Extremest | last post by:
I have a huge regex setup going on. If I don't do each one by itself instead of all in one it won't work for. Also would like to know if there is a faster way tried to use string.replace with all...
7
by: Extremest | last post by:
I am using this regex. static Regex paranthesis = new Regex("(\\d*/\\d*)", RegexOptions.IgnoreCase); it should find everything between parenthesis that have some numbers onyl then a forward...
3
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def...
15
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.