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

RegExp Questions from new v. 6 user.

Expand Messages
  • djust
    Hi, everyone! I have decided to upgrade from v. 4.95, and I expect to have a lot of questions in the near future, mostly on regexp. 1. First of all, how would
    Message 1 of 3 , Apr 20, 2010
    • 0 Attachment
      Hi, everyone!

      I have decided to upgrade from v. 4.95, and I expect to have a lot of questions in the near future, mostly on regexp.

      1. First of all, how would I look for something bounded by foo and bar, where there is definitely something between them (of unknown length), but that something might include any number of newlines? Most of my documents were written in NTP itself, and saved in the default DOS/Windows format, but I would like to be able to do this in any document.

      2. Is there anyplace I could find a good introduction to PCRE, with more examples than the PCRE man-pages give?

      Thanks.
      David.
    • Sheri
      ... The dotall option makes carriage returns and linefeeds match dot. Dotall is turned on with (?s) (?s)foo.*?bar would match foo followed by any
      Message 2 of 3 , Apr 20, 2010
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "djust" <djust@...> wrote:
        >
        > 1. First of all, how would I look for something bounded by foo
        > and bar, where there is definitely something between them (of
        > unknown length), but that something might include any number of
        > newlines? Most of my documents were written in NTP itself, and
        > saved in the default DOS/Windows format, but I would like to be
        > able to do this in any document.

        The "dotall" option makes carriage returns and linefeeds match dot. Dotall is turned on with (?s)

        (?s)foo.*?bar

        would match "foo" followed by any characters up to and including the first "bar"

        >
        > 2. Is there anyplace I could find a good introduction to PCRE,
        > with more examples than the PCRE man-pages give?
        >

        The PCRE "man pages" for patterns and syntax summary are in the regex.chm accessed from within NoteTab's Help menu.

        PCRE is also used in PHP. Much can be learned from this slideset:

        <http://gravitonic.com/c/dl.php?file=talks/php-quebec-2009/regex-clinic.pdf>

        Regards,
        Sheri
      • djust
        ... How far is it inherited? For the rest of that expression, or until it s turned off by some other (?whatever) ? ... I m downloading it now. Thanks. David.
        Message 3 of 3 , Apr 20, 2010
        • 0 Attachment
          > The "dotall" option makes carriage returns and linefeeds match dot. Dotall is turned on with (?s)
          >
          > (?s)foo.*?bar

          How far is it inherited? For the rest of that expression, or until it's turned off by some other '(?whatever)'?

          > PCRE is also used in PHP. Much can be learned from this slideset:
          >
          > <http://gravitonic.com/c/dl.php?file=talks/php-quebec-2009/regex-clinic.pdf>

          I'm downloading it now.

          Thanks.
          David.
        Your message has been successfully submitted and would be delivered to recipients shortly.