How do I create and expression to seach for end of line that does not have /001"
-
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 endHere 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 -
@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
@DBalso 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@DBand 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" -
@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
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