Jump to content
youtuber

Notepad++ 7 digit all digits, letters, alphanumeric delete regex?

Recommended Posts

Posted (edited)

I would like to delete everything that has all 7 digits in notepad ++ program.

Spoiler

157997928f57bb32c470b348ae19093c38433edf

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 by youtuber

Share this post


Link to post
Share on other sites

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+

Share this post


Link to post
Share on other sites
Posted (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 by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites

(^\d{1,7}(?:\d{1})?$\.?\r?\n?)

No, it's more appropriate, but it doesn't delete characters like -! '^ +% & / () =? _-

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

@youtuber

You need to use something like this:

Search Pattern: ^.{1,7}$
Replace Pattern: leave it blank

:)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
Posted (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 by youtuber

Share this post


Link to post
Share on other sites

@youtuber

Happy to have helped ^_^


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...