Click here to Skip to main content
15,899,026 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVB.NET Windows CE Screen Capture Pin
matt_newboy2-Jun-06 5:41
matt_newboy2-Jun-06 5:41 
QuestionHow to create an Email program in VB that can read a log file Pin
Tram882-Jun-06 4:42
Tram882-Jun-06 4:42 
Questionprint graphic [modified] Pin
codeadair2-Jun-06 3:15
codeadair2-Jun-06 3:15 
AnswerRe: print graphic [modified] Pin
Robert Rohde4-Jun-06 12:09
Robert Rohde4-Jun-06 12:09 
QuestionRetrieve value in HTML tags Pin
J Liang2-Jun-06 3:14
J Liang2-Jun-06 3:14 
AnswerRe: Retrieve value in HTML tags Pin
Ed.Poore2-Jun-06 14:11
Ed.Poore2-Jun-06 14:11 
GeneralRe: Retrieve value in HTML tags Pin
J Liang2-Jun-06 16:44
J Liang2-Jun-06 16:44 
GeneralRe: Retrieve value in HTML tags [modified] Pin
Ed.Poore3-Jun-06 0:13
Ed.Poore3-Jun-06 0:13 
J Liang wrote:
how do you guys know the formatting

Practice and experience!  It's just like another programming language, albeit with a very concise syntax, but once you know how to use it it is very powerful indeed, the only major penalty is the performance one but you can compile Regular Expressions to .NET code by using Regex.CompileToAssembly.


There are some articles here on CP as I mentioned, one is very good but I couldn't find it when I was writing the last message. Just do a search for "regular expressions", some will be related to C#, VB.NET or C++ but they all share more or less the same syntax.

Other useful sites are:
Regular-Expressions.info[^] - All information about regular expressions for different languages.
The Regulator[^] - A regular expression designer (in .NET)
RegexDesigner.NET[^] - Another regular expression designer (in .NET by Chris Sells)
RegexLib [^]- A library of useful regular expressions.

By the way if you want to extract the text, use a named group e.g. \<td[^\>]*\>(?<text>[^\<]+)\</td\><td[^\><text>, you'll notice that the parentheses now have a name following them in the square brackets (basically the syntax for a named group is </td[^\>(?<name><name><span style="font-style: italic;">regex</span>)</name><td[^\><name>). You can then retrieve the text that matches that group by something like the following:
</td[^\>
<td[^\><name>Regex.Match(inputString, "</name></td[^\>\<td[^\>]*\>(?<text>[^\<]+)\</td\><td[^\><name><td[^\>", RegexOptions.Compiled).Groups("text").Value</td[^\></name></td[^\>
<td[^\><name><td[^\>
(Sorry if I got the syntax slightly wrong for the code but I primarily use C#).  You can see that you can access one of the groups of text through it's name as specified in the regex.

Hope this helps.  I actually learnt most of my regex stuff from Francesco Balena's "Programming Visual Basic .NET" book by the Microsoft Press.  (Yeah, I started out with VB then moved to C#) and it's a very good general book on .NET (1.1).
</td[^\></td[^\>


You know you're a Land Rover owner when the best route from point A to point B is through the mud.

Ed
Last modified: 03 June 2006 05:15:40 -- Quote

GeneralRe: Retrieve value in HTML tags [modified] Pin
J Liang3-Jun-06 3:09
J Liang3-Jun-06 3:09 
QuestionHelpcursor on a ToolStripMenuItem Pin
Sugan V2-Jun-06 2:02
Sugan V2-Jun-06 2:02 
AnswerRe: Helpcursor on a ToolStripMenuItem Pin
Robert Rohde4-Jun-06 12:11
Robert Rohde4-Jun-06 12:11 
QuestionRe: Helpcursor on a ToolStripMenuItem Pin
Sugan V4-Jun-06 19:00
Sugan V4-Jun-06 19:00 
AnswerRe: Helpcursor on a ToolStripMenuItem Pin
Robert Rohde4-Jun-06 22:21
Robert Rohde4-Jun-06 22:21 
QuestionRe: Helpcursor on a ToolStripMenuItem Pin
Sugan V4-Jun-06 22:34
Sugan V4-Jun-06 22:34 
QuestionRe: Helpcursor on a ToolStripMenuItem Pin
Sugan V7-Jun-06 1:29
Sugan V7-Jun-06 1:29 
Questionvolume shadow copy service Pin
borat2-Jun-06 1:18
borat2-Jun-06 1:18 
QuestionWhat is this Code snippet meaning? Pin
Krishnaraj Barvathaya B2-Jun-06 1:12
Krishnaraj Barvathaya B2-Jun-06 1:12 
AnswerRe: What is this Code snippet meaning? Pin
Krishnaraj Barvathaya B2-Jun-06 1:12
Krishnaraj Barvathaya B2-Jun-06 1:12 
GeneralRe: What is this Code snippet meaning? Pin
J4amieC2-Jun-06 1:45
J4amieC2-Jun-06 1:45 
GeneralRe: What is this Code snippet meaning? Pin
FrankyT2-Jun-06 16:28
FrankyT2-Jun-06 16:28 
GeneralRe: What is this Code snippet meaning? Pin
Krishnaraj Barvathaya B4-Jun-06 21:38
Krishnaraj Barvathaya B4-Jun-06 21:38 
Questionhow to convert number to currency and currency to number Pin
roitha2-Jun-06 0:19
roitha2-Jun-06 0:19 
AnswerRe: how to convert number to currency and currency to number Pin
Steve Pullan2-Jun-06 1:18
Steve Pullan2-Jun-06 1:18 
QuestionHow to Handle the event raised by control inside the Template column of a DataGrid? Pin
Krishnaraj Barvathaya B1-Jun-06 23:57
Krishnaraj Barvathaya B1-Jun-06 23:57 
AnswerRe: How to Handle the event raised by control inside the Template column of a DataGrid? Pin
FrankyT2-Jun-06 16:51
FrankyT2-Jun-06 16:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.