Hi,
I just started looking at RegEx, and used one of gigemboy's to get started, which was great!
Now though I have a specific prob and I can't seem to work it out. I have a file in this format:
VB Code:
Dim Test As String = "There once was a\nboy named Freddy \nand he\nliked his big fat Teddy\n" Dim Matches As MatchCollection = Regex.Matches(Test, "((?<!\\n)\s*[A-Za-z]+\s*)+(?=\\n)")
"\n" is a line feed character. I want to pull out all the seperate lines. With the above code I get:
There once was a
nboy named Freddy
nand he
nliked his big fat Teddy
...notice the "n" at the beginning if the 2nd and onward lines.
BTW the above is just a sample sentence for the format.
Thx for your help. RegEx looks like being really cool. Pushing the comfort zone.![]()




Reply With Quote