Loading ...
Sorry, an error occurred while loading the content.

43795Re: Matching Across Lines

Expand Messages
  • Antoine J. Mechelynck
    Oct 1, 2003
    • 0 Attachment
      Scott LaBounty <slabounty@...> wrote:
      > I have a file that looks like:
      >
      > SI: data
      > SI: data
      > SI: data
      > SK: data
      > SK: data
      > SK: data
      > SK: data
      > SI: data
      > SK: data
      >
      > etc.
      >
      > I'm trying to get a regular expression that will grab all of the
      > adjacent SI or SK lines (i.e. the first two SI: lines as a match).
      >
      > Any thoughts?
      >
      > Thanks,
      >
      > Scott LaBounty
      > Nexa Tehchnologies, Inc.

      Hm... Let's give it a try... What about...

      \(^S[IK]\).*$\(\1.*$\)*

      (Untested). Match start-of-lline + SI or SK, then 0 or more characters, then
      end-of-line, then zero or more of (first match plus anything to
      end-of-line).

      Regards,
      Tony.
    • Show all 3 messages in this topic