From: Joel Pearson Date: 2013-05-24T01:13:19+09:00 Subject: Regular expression to find a break in a pattern I have a large file which lots of gibberish in and I'm trying to find the meaningful sections. Essentially I'll have something like this: ________________ To: "1313131" From: "1313131" random data lines To: "1313132" From: "1313132" random data lines To: "1313133" From: "1313132" random data lines To: "1313134" From: "1313134" random data lines ________________ What I need to do is locate the line(s) where From is different from To. In this case, the one From "1313132" To "1313133". I don't know how to do this kind of match, but I assume that Ruby has a way? -- Posted via http://www.ruby-forum.com/.