youtuber Posted June 12, 2019 Share Posted June 12, 2019 (edited) I would like to delete everything that has all 7 digits in notepad ++ program. Spoiler 123456 1234567 123456! 123456' 123456^ 123456+ 123456% 123456& 123456/ 123456( 123456) 123456= 123456_ 123456- +123456 I don't want to be deleted sample 12345678 12345678+ Edited June 12, 2019 by youtuber Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 12, 2019 Moderators Share Posted June 12, 2019 Are you trying to do this with AutoIt? Or just in Notepad++? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
youtuber Posted June 12, 2019 Author Share Posted June 12, 2019 No, just Notepad ++ Ctrl-H (Replace) for example i want to delete 1,2,3,4,5,6,7 digit ve ones here 1 12 123 1234 12345 123456 1234567 123456! 123456' 123456^ 123456+ 123456% 123456& 123456/ 123456( 123456) 123456= 123456_ 123456- +123456 !autoit autoit+ Link to comment Share on other sites More sharing options...
Earthshine Posted June 12, 2019 Share Posted June 12, 2019 (edited) does this fit your bill https://stackoverflow.com/questions/11797897/regular-expressions-match-exactly-7-or-9-digits I modified it to work in Sublime Text to meet your specs. (^\d{7}(?:\d{1})?$) also this should work for Notepad ^(\d{7}(?:\d{1})?$) that matches your strings Edited June 12, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
youtuber Posted June 12, 2019 Author Share Posted June 12, 2019 (^\d{1,7}(?:\d{1})?$\.?\r?\n?) No, it's more appropriate, but it doesn't delete characters like -! '^ +% & / () =? _- Link to comment Share on other sites More sharing options...
Earthshine Posted June 12, 2019 Share Posted June 12, 2019 (edited) then you need to develop the expression I provided until it does I guess. regexp doesn't delete anything, it matches things Edited June 12, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
youtuber Posted June 12, 2019 Author Share Posted June 12, 2019 @Earthshine No, but Notepad++ has a delete feature if the regex comparison is correct and the Replace with Box is empty... Spoiler Link to comment Share on other sites More sharing options...
Earthshine Posted June 12, 2019 Share Posted June 12, 2019 looks like you have some development to do to get the matching correct. My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
mikell Posted June 12, 2019 Share Posted June 12, 2019 7 hours ago, youtuber said: I would like to delete everything that has all 7 digits Apparently you mean "characters" not "digits" (which in regex are numbers only) So I suggest "^.{7}$" which matches 7 chars exactly youtuber 1 Link to comment Share on other sites More sharing options...
youtuber Posted June 12, 2019 Author Share Posted June 12, 2019 (edited) @mikell No, all characters including letters and numbers and alphanumerics. If 1 digit and 7 digit. I guess this is what I want, or you might have a suggestion. https://regex101.com/r/iT4qFr/1 ^.{7}$|(^\d{1,7}?$\.?\r?\n?) Edited June 12, 2019 by youtuber Link to comment Share on other sites More sharing options...
mikell Posted June 12, 2019 Share Posted June 12, 2019 Sorry, I don't understand what you want exactly. The requirements are not clear Link to comment Share on other sites More sharing options...
youtuber Posted June 12, 2019 Author Share Posted June 12, 2019 @mikell Spoiler Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 12, 2019 Share Posted June 12, 2019 @youtuber You need to use something like this: Search Pattern: ^.{1,7}$ Replace Pattern: leave it blank youtuber 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Danp2 Posted June 12, 2019 Share Posted June 12, 2019 This seems to work for me -- ^(.){0,7}\r\n youtuber 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
youtuber Posted June 12, 2019 Author Share Posted June 12, 2019 (edited) 18 minutes ago, Danp2 said: This seems to work for me -- ^(.){0,7}\r\n ^.{1,7}$\r\n or ^.{0,7}$\r\n @Danp2 @FrancescoDiMuro Thanks These two work great Edit Note: Which one do you recommend? I have many tests to find a bug. Edited June 12, 2019 by youtuber Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 12, 2019 Share Posted June 12, 2019 @youtuber Happy to have helped youtuber 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
mikell Posted June 13, 2019 Share Posted June 13, 2019 ^.{1,7}$\R? \R? = newline sequence , optional to match on a last line if no trailing newline Now it was clear FrancescoDiMuro and youtuber 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now