regex

  • Thread starter Thread starter Skur
  • Start date Start date
S

Skur

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...
 
You may try with something like:

<div\s+class="dummy"[^>]*>\s*([^<]*)\s*</div>

and get the group 1 from the resulting match (e.g. myMatch.Groups[1].Value).
 
You may try with something like:
<div\s+class="dummy"[^>]*>\s*([^<]*)\s*</div>

and get the group 1 from the resulting match (e.g.
myMatch.Groups[1].Value).
NICE!!
and now... do You know how to solve in an easy way problem of searching a
text looking for multiply patterns?
e.g. i have like 10 possible patterns to look after and would like in each
every step of .GetNextMatch search for all of them , not just one....
 
Back
Top