Help with regexp

Clovertech Forums Read Only Archives Cloverleaf General Help with regexp

  • Creator
    Topic
  • #51820
    Michael Hertel
    Participant

      I’m using tpsDirParse on an ftp interface.

      I feed it {PATTERN ^pt*} thinking it will find only files that start with pt

      Silly me, it found and liked pk_diag_2010_06.dat

      Did I mention I don’t like regexp in the first place? 🙂

      Rather than figuring this out on my own or recoding, could one of you tell me what pattern I would want?

      Thanks in advance!

    Viewing 5 reply threads
    • Author
      Replies
      • #71847
        Kevin Kinnell
        Participant

          Michael Hertel wrote:

          I feed it {PATTERN ^pt*} thinking it will find only files that start with pt

          Silly me, it found and liked pk_diag_2010_06.dat

          You told it to look for patterns that match

          Starting with ‘p’, and followed by an number of ‘t’, including none.

          You could fix it with ^pt+ (start with ‘p’ followed by at least one ‘t’) or

          ^pt.* (start with ‘p’ followed by ‘t’ followed by any number of anything.)

          HTH

        • #71848

          Please place the related block of code from your script and a directory listing from the ftp server.

          -- Max Drown (Infor)

        • #71849
          Michael Hertel
          Participant

            From tpsDirParse:

            if { [regexp — $pattern $fileName] } {

            [code]

          • #71850
            Jim Kosloskey
            Participant

              Michael,

              Would lmatch work for you instead of regexp?

              I use lmatch in my directory parse routine and it does the trick.

              There are switches to control the lmatch (-exect, -glob, and -regexp if I recall – but I understand not wanting to use regexp if possible).

              If you want I can send you those procs and you can see what I did.

              just email me.

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            • #71851
              Michael Hertel
              Participant

                Thanks Jim,

                lmatch probably would work.

                I was hoping to get by with what I had without recoding.

                That being said, I’m about to start working with 5.8 and will probably take you up on your offer.

              • #71852
                Michael Hertel
                Participant

                  Thanks Jim,

                  lmatch probably would work.

                  I was hoping to get by with what I had without recoding.

                  That being said, I’m about to start working with 5.8 and will probably take you up on your offer.

              Viewing 5 reply threads
              • The forum ‘General’ is closed to new topics and replies.