Re: Easy (?!) regular expression -- find line breaks



On Wed, 13 Jun 2007 20:55:10 -0700, Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx> wrote:

[...]
If I want to take a string and break it into individual lines based on a specific pattern ("\r\n" in this case, but I don't think it matters), I can easily write a loop that does this by scanning through the string accumulating characters and spitting out a new string each time it hits the "\r\n". But I figured Regex ought to be able to do the scanning for me, so that all I have to loop through are the matches.

And just to clarify...

Yes, I understand that I can just use String.Split() to do this. I'm talking about the more general question of the matching, and my little self-assigned homework exercise to try to learn how Regex works.
.