Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, January 12, 2015 4:57 AM
How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string.
All replies (2)
Monday, January 12, 2015 6:15 AM ✅Answered | 2 votes
If you want to replace the source lines in Visual Studio, then go to Replace in Files dialog, select “Use Regular Expressions” and use this expression:
^[ \t]*SUB_NAME[ \t]*=[ \t]*((\.+?\)|('.+?'))[ \t]*;[ \t]*\r?\n
Enter an empty string in “Replace with”.
If you are using VB.NET, then remove ‘;’. Note that lines with comments or escape sequences are not considered.
Monday, January 12, 2015 5:16 AM | 1 vote
How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string.
Lines in what? And what language are you using to develop with?
Are the lines in a text file? A RichTextBox? A TextBox? Some other control? A List(Of String)?
Is there some expectation by you that by providing what you wrote in your question post that the knowledge in your mind about what you are thinking about will mysteriously emanate to anybody reading your post so all of the sudden your knowledge will become their knowledge and they will be able to provide you with an answer as they will suddenly understand what you are trying to do? Because that's probably impossible. Most people try providing enough information in a question so anybody, even stupid people like me, can understand what they want. Maybe you should try that. As well as selecting an appropriate forum for your question in the future. Usually a question like this is related to programming in a particular language therefore a language forum may be a good choice. Or not.
La vida loca