My question is how do you regex something that is NOT what my current regex is.
My regex is: 9\d\d\d\d\d\d\d\d\d
I’m trying to find 10 digit numbers that start with 9.
But now I want to find, those who are opposite to this.
How do i do that? I’m trying to use it with notepad++ regex, find those who are not 10 digit and doest start with 9, and delete them.
I need to delete: everything, regardless of numbers of digits as long as its not 10 digit and doesnt start with 9.
Thank you.
I have a long file that looks like this,
905664572
9055148
9052836956
9054950806
9059105646
905403434
905654765
9058618018
90547214
where i need to get rid of all that is not 10 digit.
while using notepad++
this regex works: 9\d\d\d\d\d\d\d\d\d
this regex doesn’t: 9\d{9} AND ^9(\d{0,9}
This worked to what I was trying to do:
(?<!\d)[0-9](\d{0,8})
Your regex is
9\d\d\d\d\d\d\d\d\dand could be shortened to9\d{9}…Well, the opposite could be
(?!9\d\d\d\d\d\d\d\d\d)or(?!9\d{9})or9(?>!\d{9})edit:
the working express:
(?<!\d)9(\d{0,8}|\d{10,})(?=\D)