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

Re: regex Match but exclude

Expand Messages
  • brother.gabriel
    Thank you for the explanation. It does get clearer and clearer.
    Message 1 of 10 , Jul 1, 2011
    View Source
    • 0 Attachment
      Thank you for the explanation. It does get clearer and clearer.

      --- In power-pro@yahoogroups.com, "Sheri" <sherip99@...> wrote:
      >
      > --- In power-pro@yahoogroups.com, "brother.gabriel" <brgabriel@> wrote:
      > >
      > > Hey! That did it!
      > > Now, why wouldn't it work like that using the $ instead of \r\n ?
      > >
      > >
      >
      > \r and \n are characters inside a character class in the referenced pattern. "=([^|\r\n]+)" means capture all characters that are not |, \r, or \n that immediately follow an equal sign. Stop when a |, \r or \n is reached.
      >
      > "$" is not a character, it is a zero width assertion representing a location on a line just before any line breaking characters. So it would not be valid in the character class. It would not achieve the objective outside the character class, because there might be a comment after the part that should be captured, and before the end of the line.
      >
      > Hope that helps explain it.
      >
      > >
      > > --- In power-pro@yahoogroups.com, "Sheri" <sherip99@> wrote:
      > > >
      > > > > Try: (?m)^([^;][^=\r\n]*)=([^|]+)
      > > >
      > > > Sorry, make that:
      > > > (?m)^([^;][^=\r\n]*)=([^|\r\n]+)
      > > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.