Home All Groups Group Topic Archive Search About
Author
10 Mar 2006 11:59 AM
Josema
Hi to all,

i did this regular expresion <!--!.*!--> that matchs all occurrences of type

<!--!Name!-->
<!--!Description!-->

and so on...

I would like to know the regular expression to get (for instance) for this
example, only the matches Name and Description without the start <!--! and
the end !-->

--
Thanks
Regards.
Josema

Author
10 Mar 2006 12:21 PM
Kevin Spencer
Name
Description

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

Show quoteHide quote
"Josema" <Jestr***@ocu.org> wrote in message
news:6099F024-3C31-4561-90A8-00411A629FCB@microsoft.com...
> Hi to all,
>
> i did this regular expresion <!--!.*!--> that matchs all occurrences of
> type
>
> <!--!Name!-->
> <!--!Description!-->
>
> and so on...
>
> I would like to know the regular expression to get (for instance) for this
> example, only the matches Name and Description without the start <!--! and
> the end !-->
>
> --
> Thanks
> Regards.
> Josema
Are all your drivers up to date? click for free checkup

Author
10 Mar 2006 12:45 PM
Josema
Hi, Kevin....

i would need a regular expresion like <!--!.*!--> cause i dont know what
kind of data come... could be <!--!Name!--> <!--!Description!--> or
<!--!xxxxx!-->

Do you know how could be the regular expresion?
--
Thanks
Regards.
Josema


Show quoteHide quote
"Kevin Spencer" wrote:

> Name
> Description
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
>
> Presuming that God is "only an idea" -
> Ideas exist.
> Therefore, God exists.
>
> "Josema" <Jestr***@ocu.org> wrote in message
> news:6099F024-3C31-4561-90A8-00411A629FCB@microsoft.com...
> > Hi to all,
> >
> > i did this regular expresion <!--!.*!--> that matchs all occurrences of
> > type
> >
> > <!--!Name!-->
> > <!--!Description!-->
> >
> > and so on...
> >
> > I would like to know the regular expression to get (for instance) for this
> > example, only the matches Name and Description without the start <!--! and
> > the end !-->
> >
> > --
> > Thanks
> > Regards.
> > Josema
>
>
>
Author
10 Mar 2006 2:05 PM
Kevin Spencer
Sorry, Josema, I misunderstood your question. However, I can see that it has
been answered. Good luck!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

Show quoteHide quote
"Josema" <Jestr***@ocu.org> wrote in message
news:FD0DCFD3-8BA0-45D6-B824-8366FF73C978@microsoft.com...
> Hi, Kevin....
>
> i would need a regular expresion like <!--!.*!--> cause i dont know what
> kind of data come... could be <!--!Name!--> <!--!Description!--> or
> <!--!xxxxx!-->
>
> Do you know how could be the regular expresion?
> --
> Thanks
> Regards.
> Josema
>
>
> "Kevin Spencer" wrote:
>
>> Name
>> Description
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>>
>> Presuming that God is "only an idea" -
>> Ideas exist.
>> Therefore, God exists.
>>
>> "Josema" <Jestr***@ocu.org> wrote in message
>> news:6099F024-3C31-4561-90A8-00411A629FCB@microsoft.com...
>> > Hi to all,
>> >
>> > i did this regular expresion <!--!.*!--> that matchs all occurrences of
>> > type
>> >
>> > <!--!Name!-->
>> > <!--!Description!-->
>> >
>> > and so on...
>> >
>> > I would like to know the regular expression to get (for instance) for
>> > this
>> > example, only the matches Name and Description without the start <!--!
>> > and
>> > the end !-->
>> >
>> > --
>> > Thanks
>> > Regards.
>> > Josema
>>
>>
>>
Author
10 Mar 2006 12:46 PM
Lasse V=e5gs=e6ther Karlsen
> Hi to all,
>
> i did this regular expresion <!--!.*!--> that matchs all occurrences
> of type
>
> <!--!Name!-->
> <!--!Description!-->
> and so on...
>
> I would like to know the regular expression to get (for instance) for
> this example, only the matches Name and Description without the start
> <!--! and the end !-->
>

@"<!--!(?<text>.*?)!-->"

This will give you a named group.

usage:

Regex re = new Regex(@"...");
Match ma = re.Match(s);
if (ma.Success)
{
    String text = ma.Groups["text"].Value;
    ....
}

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Author
10 Mar 2006 1:30 PM
Josema
Thanks a lot Karlsen, whas exactly the stuff that im searching for
--
Thanks
Regards.
Josema


Show quoteHide quote
"Lasse Vågsæther Karlsen" wrote:

> > Hi to all,
> >
> > i did this regular expresion <!--!.*!--> that matchs all occurrences
> > of type
> >
> > <!--!Name!-->
> > <!--!Description!-->
> > and so on...
> >
> > I would like to know the regular expression to get (for instance) for
> > this example, only the matches Name and Description without the start
> > <!--! and the end !-->
> >
>
> @"<!--!(?<text>.*?)!-->"
>
> This will give you a named group.
>
> usage:
>
> Regex re = new Regex(@"...");
> Match ma = re.Match(s);
> if (ma.Success)
> {
>     String text = ma.Groups["text"].Value;
>     ....
> }
>
> --
> Lasse Vågsæther Karlsen
> http://usinglvkblog.blogspot.com/
> mailto:la***@vkarlsen.no
> PGP KeyID: 0x2A42A1C2
>
>
>

Bookmark and Share