Re: Need help with a regular expression!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi David,

You need to use this RegEx

<([map][map]*)[^>]*>(.*?)</\1>

Try this, might be usefull. If not then keep your string in one line then
search with above regex.

Regards
Sachin Korgaonkar



"David Hearn" <david.hearn@xxxxxxxxxxxxxxx> wrote in message
news:uw7ECbdQFHA.2948@xxxxxxxxxxxxxxxxxxxxxxx
> I am trying to use RegEx.Match to locate some text in an HTML file. I am
> trying to find everything between <map> files so that I can grab the
> coordinates. The map files looks like this:
>
> <map name="Map4">
> <area shape="rect" coords="160,158,443,163" href="#">
> <area shape="rect" coords="161,166,442,171" href="#">
> <area shape="rect" coords="160,184,433,304" href="#">
> <area shape="rect" coords="160,314,434,446" href="#">
> <area shape="rect" coords="160,455,435,564" href="#">
> </map>
>
> So I need a regular expression to find <map {everything in between} </map>
>
> Can anyone help me with this?
>
> Thanks in advance!
>
>


.



Relevant Pages

  • Re: Parse a filename (this SHOULD be easy, right?)
    ... > that needs to be sprayed with a regex. ... I prefer his regular expession ... Regards, ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: Ada 2005?
    ... You are right and I did see my error and correted it by translating the ... regex to plain english. ... With Regards ... Martin ...
    (comp.lang.ada)
  • Re: Regex File contents
    ... But I was hoping there was some kind file/memory trickery that regex ... Frank ... > Nopes I think. ...
    (microsoft.public.dotnet.general)
  • Re: Matching of optional parts in regular expressions
    ... All three examples work absolutely correct. ... Regex is not anchored. ... > I think that the specified strings must not match to the pattern. ... Best regards ...
    (comp.lang.python)
  • Re: Matching of optional parts in regular expressions
    ... All three examples work absolutely correct. ... Regex is not anchored. ... > I think that the specified strings must not match to the pattern. ... Best regards ...
    (comp.lang.tcl)