|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Regular ExpresionsHi 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 Name
Description -- Show quoteHide quoteHTH, 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 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? -- Show quoteHide quoteThanks 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 > > > Sorry, Josema, I misunderstood your question. However, I can see that it has
been answered. Good luck! -- Show quoteHide quoteHTH, 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: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 >> >> >> > Hi to all, @"<!--!(?<text>.*?)!-->"> > 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 !--> > 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 Thanks a lot Karlsen, whas exactly the stuff that im searching for
-- Show quoteHide quoteThanks Regards. Josema "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 > > >
Other interesting topics
newbie: GetType or typeof?
How to Anonymous IP address in C# string dictionary and memory issue. Why won't you give me your scrollbars?! I hate you, TreeView! C++ class in DLL to be imported to C# file uploading in windows application in .net Desing problem What is wrong with this Producer-Consumer sample? How select from 2 ADO.NET DataTables? Current Program's Process ID |
|||||||||||||||||||||||