Community
    • Login

    How do I create and expression to seach for end of line that does not have /001"

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 967 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Talbot TeboeT Offline
      Talbot Teboe
      last edited by

      Fellow Notepad++ Users,

      Could you please help me the the following search-and-replace problem I am having?

      DESCRIBE CIRCUMSTANCES OF YOUR QUESTION
      using the line that contains @DB/ as a starting point
      I would like to locate any line with the @DB/ that does NOT have /001" at the end

      Here is the data I currently have (“before” data):
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “PN1204-10-00A-prt489.prt”
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt489/001”
      &LOG Container: “”
      &LOG Part_Type: “”
      &LOG Part_Name: “”
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “PN1204-10-00A-prt49.prt”
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt49/001”
      &LOG Container: “”
      &LOG Part_Type: “”
      &LOG Part_Name: “”
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “PN1204-10-00A-prt490.prt”
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt490/001”
      &LOG Container: “”
      &LOG Part_Type: “”
      &LOG Part_Name: “”
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “PN1204-10-00A-prt491.prt”
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/PN1204-10-00A-prt491/001”
      &LOG Container: “”
      &LOG Part_Type: “”
      &LOG Part_Name: “”
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “FANUC_R-30IB_IPENDANT_stp.prt”
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/FANUC_R-30IB_IPENDANT_stp/001”
      &LOG Container: “”
      &LOG Part_Type: “”
      &LOG Part_Name: “”
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “FASCE-00-31-AVV._F177.8-0033790.prt”
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/FASCE-00-31-AVV./F177.8-0033790/001”
      &LOG Container: “”
      &LOG Part_Type: “”
      &LOG Part_Name: “”
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “FASCE-00-31-AVV._F177.8-0045181.prt”
      &LOG Naming_Technique: AUTO_GENERATE Clone_Name: @DB/157465/001
      &LOG Container: “”
      &LOG Part_Type: “”
      &LOG Part_Name: “”
      &LOG Part_Description: “”
      &LOG Associated_Files_Directory: “”
      &LOG Part: “FASCE-08-SV-AVV._SV-177.827547.prt”
      &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: “@DB/FASCE-08-SV-AVV./SV-177.827547/001”
      Thanks for any assistance

      Mark OlsonM Talbot TeboeT 2 Replies Last reply Reply Quote 0
      • Mark OlsonM Offline
        Mark Olson @Talbot Teboe
        last edited by Mark Olson

        @Talbot-Teboe
        Please read this FAQ before asking future questions. That will help us help you.

        I also notice that you gave us example data that includes non-matches, but no matches. Every single line in your example that contains @DB also contains /001". Again, that information would have helped us help you.

        In any case, the regular expression (?-si)(?=.+@DB.*)(?!.*/001"$).* will match every line that contains @DB and does not end with /001".

        In the below example, only lines (3, 9, and 12) would match.

        &LOG Part_Description: ""
        &LOG Associated_Files_Directory: ""
        &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/ THIS WILL MATCH 1"
        &LOG Part: "PN1204-10-00A-prt489.prt"
        &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB THIS WILL NOT MATCH 1/001"
        &LOG Container: ""
        &LOG Part_Type: ""
        &LOG Part_Name: ""
        &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/ THIS WILL MATCH 2"
        &LOG Container: ""
        &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL NOT MATCH 2/001"
        &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL MATCH 3"
        &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL NOT MATCH 3/001"
        &LOG FJKRERJKJREKJREKJREKRJEKO: ""
        &LOG Naming_Technique: DEFAULT_NAMING Clone_Name: "@DB/THIS WILL NOT MATCH 4/001"
        
        1 Reply Last reply Reply Quote 4
        • Talbot TeboeT Offline
          Talbot Teboe @Talbot Teboe
          last edited by

          @Talbot-Teboe
          Sorry I didn’t realize that I needed to include lines without the /001
          In my attempt to create the expression I was not even close. I didn’t even get the last group of the expression correct
          I’d been manually searching for the lines without the /001, and had been at it for 3 hours before contacting the Community.
          Thank you very much for the assistance

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors