Here's a real quick RegEx tutorial. If you'd like you can give me a string, tell me what you want from it, and I'll show you.
Here's the string we'll work with: 18:25 You see Jo3Bingham (Level 1337). He is a programmer.
Let's rip out my name, level, and vocation but first we need to set our string and RegEx objects.
Code:
Dim LookAtText As String = "18:25 You see Jo3Bingham (Level 1337). He is a programmer."
Our first object will be the name:
Code:
Dim pName As New System.Text.RegularExpressions.Regex("\w*\s\(")
pName.Match(LookAtText).ToString()
The above code will return "Jo3Bingham (". Here's a basic breakdown; \w returns an alphanumeric character and following it with a * will return any number of characters, \s returns a whitespace, and \( returns an open parenthesis.
Next is level:
Code:
Dim regLevel As New System.Text.RegularExpressions.Regex("\d*\)")
regLevel.Match(LookAtText).ToString()
The above code will return "1337)". \d returns a numeric value and like above following it with a * will return any number of characters, and \) will return a close parenthesis.
Finally vocation:
Code:
Dim regVocation As New System.Text.RegularExpressions.Regex("(He|She)\s\w{2}\s\w\s\w*")
regVocation.Match(LookAtText).ToString()
The above code will return "He/She is a programmer". (He|She) matches one of the specified words, \s whitespace, \w {2} returns the next two letters, \s whitespace, \w letter, \s whitespace, \w* returns the rest of the letters up to the period.
Here's a "Cheat Sheet" on RegEx operators: http://www.mikesdotnetting.com/Artic...x?ArticleID=46
I know it wasn't a good tutorial, but I'm having to leave and I had that much done so I figured I'd throw it up. I'm sure there's a better way to do what I did but I just recently learned RegEx so I'm not uber good at it.